Results 1 to 4 of 4

Thread: Using Response.Redirect("Login.aspx")

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Location
    England
    Posts
    64

    Using Response.Redirect("Login.aspx")

    Hi All,

    On my home page i send the user to the login screen if they are not already logged in! Using:

    Response.Redirect("Login.aspx")

    But i dont want to do this if they are already on the Login.aspx. Is there a funtion which will show me the current page the post back came from?

    so i can say

    if ?????? <> "Login.aspx" then
    Response.Redirect("Login.aspx")
    end if

  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: Using Response.Redirect("Login.aspx")

    what does your login logic look like?

  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Using Response.Redirect("Login.aspx")

    Hey,

    You should be able to use the following:

    User.Identity.IsAuthenticated

    However, depending on what it is you are trying to do, you may be able to use the LoginView Class, or maybe the built-in authentication redirects that come with the Membership Provider in ASP.Net.

    What exactly are you trying to achieve?

    Gary

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Using Response.Redirect("Login.aspx")

    If this is in some sort of a master page event, then look at Request.Url and parse it to determine the current pagename.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width