+ 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 ...