You need to sign in to do that
Don't have an account?

possible to call pagereference from apex?
On a button click I want to call a method,perform some logic, and then call a pagereference (used elsewhere on the page as well) that then generates a redirect. Is it possible to call a PageReference from apex? If so what is the syntax to do so?
Thanks!
is the return type of the method a PageReference?
You can do the following:
If you want to call a method from controller and after performing some logic redirect to some URL then here is the code :
VFP :
Class :
Thanks
Ankit Arora
Blog | Facebook | Blog Page
I guess I had a similar problem and Ankit method would solve your problem, however If you want that pagereference you would have to use <apex:commandlink> tag with the attribute target ="_blank". Rest All remain same.
thanks