RedirectFromLoginPage

  • Thread starter Thread starter Shawn
  • Start date Start date
S

Shawn

Hi.
I'm using RedirectFromLoginPage to redirect the user if the login was
successful. The problem is that I don't want the user to be redirected to
the page he requested. I want him to be redirected to my startup page. Is
that possible?


Thanks,
Shawn
 
Shawn,

When you authenticate the user, you can perform a Response.Redirect to your
startup page and just ignore the RedirectFromLoginPage method.

Hope this helps!

Christopher Reed
Web Applications Supervisor
City of Lubbock
"The oxen are slow, but the earth is patient."
Hi.
I'm using RedirectFromLoginPage to redirect the user if the login was
successful. The problem is that I don't want the user to be redirected to
the page he requested. I want him to be redirected to my startup page. Is
that possible?


Thanks,
Shawn
 
If I simply replace RedirectFromLoginPage with Response.Redirect then the
page I'm redirecting to just sends me back to the login page again.. I'm
guessing I somehow have to tell FormsAuthentication that the user has been
authenticated.. Can you tell me how?

Shawn
 
Shawn,

Try this:

void LoginBtn_Click(Object sender, EventArgs e)
{
if (Page.IsValid)
{
// Call the authentication event handler delegate (not included
in this example).
if (FormsAuthentication.Authenticate(UserName.Text,
UserPass.Text))
{
// Return to the originally requested URL.
Response.Redirect("mystartpage.aspx");
}
else
{
Msg.Text = "Invalid Credentials: Please try again";
}
}
}

Hope this helps!


Christopher Reed
Web Applications Supervisor
City of Lubbock
"The oxen are slow, but the earth is patient."
If I simply replace RedirectFromLoginPage with Response.Redirect then the
page I'm redirecting to just sends me back to the login page again.. I'm
guessing I somehow have to tell FormsAuthentication that the user has been
authenticated.. Can you tell me how?

Shawn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top