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

Discussion in 'ASP .Net Security' started by Nugs, May 26, 2004.

  1. Nugs

    Nugs Guest

    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)
    Nugs, May 26, 2004
    #1
    1. Advertising

  2. 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);


    "Nugs" <> wrote in message
    news:...
    > 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)
    >
    >
    Marcio Kleemann, May 26, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lauchlan M
    Replies:
    2
    Views:
    486
    John Saunders
    Aug 17, 2003
  2. Alan Morris

    Preset fields in detailsview.

    Alan Morris, Oct 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    236
    Alan Morris
    Nov 23, 2006
  3. Michael
    Replies:
    2
    Views:
    115
  4. Peter Amberg
    Replies:
    13
    Views:
    170
    Thomas 'PointedEars' Lahn
    Apr 5, 2004
  5. murrayatuptowngallery

    mouseover image and object sound and preset volume level?

    murrayatuptowngallery, Nov 1, 2005, in forum: Javascript
    Replies:
    4
    Views:
    186
    Thomas 'PointedEars' Lahn
    Nov 1, 2005
Loading...

Share This Page