Create & Use Custom Controllers for Visualforce & apex
Custom Controller:
It is an Apex class that implements all of the logic for a page without leveraging a standard controller.
Custom Controllers are associated with Visualforce pages through the controller attribute.
Custom controller defines its own functionality.
Use custom controllers when you want your Visualforce page to run entirely in system mode, which does not enforce the permissions and field-level security of the current user.
You’d use this when your page isn’t dealing with a main object.
Create & Use Custom Controllers
Prologue to Custom Controllers:
Custom controllers contain custom rationale and information control that can be utilized by a Visualforce page. How Visualforce bolsters the Model– View– Controller (MVC) plan design for building web applications. Controllers regularly recover the information to be shown in a Visualforce page, and contain code that executes in light of page activities, for example, a catch being clicked. When you utilize the standard controller, a lot of, well, standard usefulness is given to you by the stage.
Make a Visualforce Page that Uses a Custom Controller:
By or take a reference the name of the controller class
<apex:page> controller Attribute
At the point when your page utilizes a custom controller, you can't utilize a standard controller.
• Open the Developer Console and snap File | New | Visualforce Page to make another Visualforce page. Enter Contacts List Controller for the page name.
• In the editorial manager, supplant any markup with the accompanying.
<apex:page controller="ContactsListController">
<apex:form>
<apex:pageBlock title="Contacts List" id="contacts_list">
<!-- Contacts List goes here -->
</apex:pageBlock>
</apex:form>
</apex:page>
When you try to save this page, you’ll get an error, because Contacts List Controller doesn’t exist yet.
Thanks for reading..............You will reach to us in a brief time-frame with the master conference and for expert direction with the accompanying of new patterns, developments and queries.












