Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Opposite of RedirectFromLoginPage? Preset page to direct to...

Reply
Thread Tools

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

 
 
Nugs
Guest
Posts: n/a
 
      05-26-2004
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(txtUserI D.Text,
chkPersistLogin.Checked)
Else
ErrorMsg.InnerHtml = "Login Failed! Please try again."
End If
End Sub
</script>

Thanks
Nugs (ASP.NET Newbie)


 
Reply With Quote
 
 
 
 
Marcio Kleemann
Guest
Posts: n/a
 
      05-26-2004
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,f alse);

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


"Nugs" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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(txtUserI D.Text,
> chkPersistLogin.Checked)
> Else
> ErrorMsg.InnerHtml = "Login Failed! Please try again."
> End If
> End Sub
> </script>
>
> Thanks
> Nugs (ASP.NET Newbie)
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
switching tgo a preset ip address Jeff Wireless Networking 1 12-31-2005 09:59 PM
White-balance preset question Cooter Digital Photography 12 06-24-2004 02:34 PM
Any software that will shut down computer at preset time? John Computer Support 5 06-23-2004 02:22 PM
What are the WB setting in Landscape preset - OLY 740 Michael Badt Digital Photography 2 05-09-2004 04:33 PM
how to preset the default font size for a web page? Michael ASP General 2 08-07-2003 10:36 AM



Advertisments