How can I call a controller method from VisualForce page without any onclick event happening? My VisualForce page would be like
<apex:page standardController="Account">
<script>
/* Here i need to call a controller class with out any onclick event. It should load by itselef */
</script>
</apex:page>
and my controller class will be like
public class OrderPadController {
/* this will be the constructor */
public PageReference openPage() {
PageReference newpage = new Pagereference('/apex'+'/pagetoopen'+'?aid='+a.id);
openorderpadembed.setRedirect(false);
return openorderpadembed;
}
From my VisualForce page I need to call the method openPage()
.
Please help me out