function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
venkyyyvenkyyy 

can we add a visualforce page in component?

Hi all, 
1) Can we add a visualforce page in lightning component?
2) Can we create two apex controllers in one lightning component?

Thanks for help in advance.
Yash Mansingh 5Yash Mansingh 5
Yes, you can. There is a default component (you'll have to access it from Lightning App builder) where you can provide a VF page name inside the component. 
Himanshu ParasharHimanshu Parashar
Hi Venky,

1. You can't add visualforce page in lightning component
2. Only one apex controller is allowed per lightning component.


Thanks,
Himanshu
Yash Mansingh 5Yash Mansingh 5
To answer your second question, you can have one custom controller only but you can fire multiple classes off one controller if you want to write SOQLs for multiple objects.
KoolABKoolAB
You can add VF Page in lightning component using Iframe tag and src=endpoint for VF page
Abhilasha_SinghAbhilasha_Singh
Hi Venky,
Go through this link: https://developer.salesforce.com/page/Lightning_FAQ#Visualforce_and_Lightning
I think this will help you.

Thanks