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
viswsanathviswsanath 

How to call controller method from visualforce page ?

HI ALL,

How to call controller method from visualforce page ?Pls Give me one example?

Thanks,
Viswa.
sandeep sankhlasandeep sankhla
Hi Viswa,

You can use action function for this need..

Example:

Class: 

public void callFromPage()
{

}

Page:


<apex:actionFunction action="{!callFromPage}" name="methodOneInJavascript" rerender="showstate">  </apex:actionFunction>


<apex:outputPanel onclick="methodOneInJavascript()" styleClass="btn" > Click Me </apex:outputPanel>

You can call this action function from javascript or any element

Please mark this as best answer if this solves your issue ...