Re: redirect not working

anonymous_at_discussions.microsoft.com
Date: 10/06/04

  • Next message: Paul Clement: "Re: Basic authentication without browser login window"
    Date: Wed, 6 Oct 2004 08:49:55 -0700
    
    

    That line detects whether the user has come to the login
    page from the homepage(index.aspx) and if so re-directs
    (doesn't work) them to the index.aspx (I changed it to a
    http:// address in the hope it would work as originally
    it was /appliedbioscience/... type URL).

    The idea behind this is that the user can login and get
    access to the restricted-access documents by logging in
    from the homepage. Otherwise they are taken to the login
    page when they try to access some restricted content and
    are redirected back to the page where they tried to
    download the content from.

    Hope this makes sense.

    Thanks in advance for any pointers you may be able to
    give.
    Matt
    >-----Original Message-----
    >What do you want to do with this line?
    >
    >if(FormsAuthentication.GetRedirectUrl
    >(txtUserName.Text,false)
    =="/appliedbioscience/index.aspx")
    >
    >
    >
    >--
    >Daniel Fisher(lennybacon)
    > MCP C# ASP.NET
    >Blog: http://www.lennybacon.com/
    >
    >"Matt Owens" <anonymous@discussions.microsoft.com> wrote
    in message
    >news:422201c4abae$0f994a60$a301280a@phx.gbl...
    >>I have a login page which does not redirect the user
    once
    >> the code has been executed, see below. Whats strange is
    >> it works perfectly on my localhost when debugging,
    >> however it fails to redirect when depolyed to a remote
    >> server. Am I missing any IIS settings or anything? The
    >> login page just reloads once the login button has been
    >> clicked.
    >>
    >> Code for the login button:
    >>
    >> private void _btnLogin_Click(object sender,
    >> System.Web.UI.ImageClickEventArgs e)
    >> {
    >> if (IsValidUser(txtUserName.Text,
    >> txtPassword.Text)) //interacts with the database. This
    >> method is fine
    >> {
    >> if(FormsAuthentication.GetRedirectUrl
    >> (txtUserName.Text,false)
    =="/appliedbioscience/index.aspx")
    >> {
    >> FormsAuthentication.SetAuthCookie
    >> (txtUserName.Text,false);
    >> Response.Redirect
    >>
    ("http://www.appliedbioscience.co.uk/appliedbioscience/ind
    >> ex.aspx",false); //fails here
    >> }
    >> else if
    >> ((FormsAuthentication.GetRedirectUrl
    >> (txtUserName.Text,false).ToUpper().IndexOf("ADMIN") !
    = -
    >> 1) && (string)Session["Role"]!="admin")
    >> phMsg.Controls.Add(new
    >> LiteralControl("<font color=red>ERROR: You do not have
    >> the necessary privellages to administrate this
    >> site</font>"));
    >> else
    >>
    >> FormsAuthentication.RedirectFromLoginPage
    >> (txtUserName.Text,false); //fails here too
    >> }
    >> else
    >> {
    >> phMsg.Controls.Add(new LiteralControl
    >> ("<font color=red>ERROR: Invalid Username /
    >> Password</font>"));
    >> }
    >> }
    >>
    >> Thanks,
    >> Matt
    >>
    >>
    >
    >
    >.
    >


  • Next message: Paul Clement: "Re: Basic authentication without browser login window"

    Relevant Pages

    • Re: Default.aspx - newbie Q`
      ... check and redirect to the ReturnURL or Selected.aspx depending on the case. ... > and replace it with something that takes then straight to the login page. ... >> Curt Christianson ... >>> authentication ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Default.aspx - newbie Q`
      ... check and redirect to the ReturnURL or Selected.aspx depending on the case. ... > and replace it with something that takes then straight to the login page. ... >> Curt Christianson ... >>> authentication ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: doesnt redirect
      ... Look under the Security tab. ... One of them is called the Internet zone and probably the one you are using. ... or better explain what you mean by>> redirect ... I think there are 2 interstitchal pages after submitting those login credentials before you get to the mailbox web page. ...
      (microsoft.public.windows.inetexplorer.ie6.browser)
    • Re: Stuck with form validation
      ... stay in the login page ... Not quite sure what you are expecting $sql to be. ... #redirect to other page ... Returns the number of rows affected by the last row affecting command, ...
      (perl.dbi.users)
    • Re: Accessing and displaying SSL web pages and cookies from a windows form
      ... or LoadXML calls to urls on the website in order to get data or post data to ... first redirected to a SSL login page, if a particular cookie is not present, ... cookie is not present instead of getting the data. ... >> the data in the cookie and also not redirect to the login page. ...
      (microsoft.public.dotnet.languages.vb)