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
sqyahoosqyahoo 

redirect function doesn't work

I have try to make page redirect function like this
 
Code:
public PageReference Test(){
 PageReference pageError = new PageReference('/Apex/Error_Page');
 pageError.setRedirect(true);
 
 return pageError;
}

but when the code executed doesn't work in my instance.
The page still in the same page without any text generated (fully blank page). 
In another instance I have try this code and working well.
Anyone know my problems?
 
Thanks.
yibongleeyibonglee
try this ..



public PageReference Test(){
PageReference pageError = Page.Error_Page;
pageError.setRedirect(true);

return pageError;
}