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
SF DEVSF DEV 

Cancel page - loaded using Sites , outof salesforce

cancel Functionality for visual force loading using Sites

I have created a page and its access using sites, when user loads the page out side the salesforce using site, and when they cancel the page by clicking cancel button its giving error:

Authorization Required 

You must first log in or register before accessing this page. 
If you have forgotten your password, click Forgot Password to reset it. 


How to cancel the page by command button

My code:
public class loadtrial {
    ApexPages.standardController load_t  = null;
    public loadtrial(ApexPages.standardController sc)
    {
      load_t = sc;
    }
  
    }
    public PageReference Cancel()
    {
      return load_t.cancel();
    }
    
}