129k views
4 votes
How many Controllers can be used on single VF page?

1 Answer

6 votes

Final answer:

On a single VF page, we can use one controller, which can be a standard controller or a custom controller. A standard controller is associated with a specific standard object, while a custom controller is used for interacting with multiple objects or custom logic.

Step-by-step explanation:

On a single Visualforce (VF) page, we can use one controller. A VF page can have only one associated controller. However, the controller can be a standard controller or a custom controller.

A standard controller is used when the VF page is associated with a specific standard object in Salesforce, such as Account or Contact. In this case, the standard controller handles the logic for that object.

A custom controller is used when the VF page needs to interact with multiple objects or perform some custom logic. You can define a custom controller class for this purpose.

User Arkellys
by
8.9k points