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
Matt FieldMatt Field 

Send user to confirmation webpage after registering

I have a registration controller that has the following code snippet:

public PageReference mysaveLead() {        ld.LeadSource = 'Early Warning Summit';        ld.OwnerId = '005400000012y4L';                message = 'Thank you for registering ' + ld.FirstName + '. Please Select File->Print in your browser to print your registration information.';        mode = true;        Contact[] c = [Select Name, LastName, FirstName, Id, Email FROM Contact WHERE Email =: ld.Email];        // Campaign ID 70140000000MPzt is the Summit 2011 Campaign        // Campaign ID 70140000000Mm1c is the Summit 2012 Campaign        // Campaign ID 70140000000O0nr is the Summit 2013 Campaign         Campaign cam = [ SELECT ID, Status FROM Campaign WHERE ID='70140000000osgB'];

Currently the controller shows a confirmation message at the top of the page when the user has completed the registration.  I would like to change that to sending the user to a webpage that will be set up to show that the user has successfully registered.  Can someone tell me how to push them to the webpage?  I think that I just have to change the "message =" line, but I don't know what to change it to.

Thanks
Damien Phillippi033905702927186443Damien Phillippi033905702927186443
You need need simply return a PageReference that specifies the page:

return new PageReference('URL_OF_NEW_PAGE_HERE');