You need to sign in to do that
Don't have an account?
very urgent issue on customer portal
How can i redirect to other visualforce page when the login credential is true.
Here i am posting my code :
global with sharing class SiteLoginController {
global String username {get; set;}
global String password {get; set;}
global PageReference login() {
String startUrl = System.currentPageReference().getParameters().get('startURL');
return Site.login(username, password, startUrl);
// return null;
//return.page.Account;
}
if return null is giving it is returing nothing as usally.
if return page.Account; is giving then it is redirecting with out validating login credential is true.
Can any one help on this issue.
Perhaps something like:
You can change the startURL to the relative url of page where you want to redirect after login to site , Try Following :-
global with sharing class SiteLoginController {
global String username {get; set;}
global String password {get; set;}
global PageReference login() {
String startUrl = System.currentPageReference().getParameters().get('startURL');
startUrl = '/apex/<Name of Visualforce page>';
return Site.login(username, password, startUrl);
}