Salesforce Platform Developer Practice Exam 2025 – All-in-One Guide to Ace Your Certification!

Question: 1 / 400

Which syntax represents a custom controller in VisualForce?

<apex:page controller="MyController">

The syntax that represents a custom controller in VisualForce is to use the controller attribute within the apex:page tag. By specifying controller="MyController", you indicate that the page will utilize a custom Apex controller class called MyController. This tells Salesforce to instantiate and use this specific controller to manage data and actions for the VisualForce page.

Custom controllers provide greater flexibility and control over the page's behavior compared to standard controllers, allowing developers to implement specific business logic and handle complex user interactions. The other options do not conform to the correct syntax for defining a custom controller, which is why they are not accurate representations. Therefore, the correct answer demonstrates the appropriate way to link a VisualForce page to a custom controller class.

Get further explanation with Examzify DeepDiveBeta

<apex:page standardController="MyController">

<apex:page customController="MyController">

<apex:page privateController="MyController">

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy