Ask Search:
durga ananddurga anand 

can we write standard controller and custom controller in one visualforce page?

my doubt is visualforce page have one custom controller and one standard controller ......................
Karanraj SankaranarayananKaranraj Sankaranarayanan
Durga,

You can use Extensions when you are going to perform both standard and custom controller
Thylaksoft LLCThylaksoft LLC
Hi durga,

A custom and standard controller cannot be referenced in the same page. Another way is you use extensions instead of Custom Controller.

ex:
  <apex:page standardcontroller=""  extensions="controller name"/>
 
Jatin JainJatin Jain
Ideally, if you need to write any custom code for standard object, then you should use extensions.Both custom and standard controller should not be supported at the same time else how would sf know to call which controller ?

HTH