Opposite of RedirectFromLoginPage? Preset page to direct to...

N

Nugs

How can I set the page that the login page needs to send the user to. I have
a login page that does the RedirectFromLoginPage method, but I am now
needing to explicitly tell the login page where to go instead of it looking
for the previously requested page. How would I do that?

My code is as follows:
<script language="vb" runat="server">
Sub Login_Click(Src As Object, E As EventArgs)
IF eon_login.Recordcount > 0 then
FormsAuthentication.RedirectFromLoginPage(txtUserID.Text,
chkPersistLogin.Checked)
Else
ErrorMsg.InnerHtml = "Login Failed! Please try again."
End If
End Sub
</script>

Thanks
Nugs (ASP.NET Newbie)
 
M

Marcio Kleemann

You can set the authentication cookie and then use response redirect, as
follows (sorry, this is C# but you should be able to easily translate):

FormsAuthentication.SetAuthCookie(txtUserID.Text,false);

Response.Redirect("PageYouWant.aspx",true);
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top