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
Re: Using Response.Redirect("Login.aspx")
what does your login logic look like?
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
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.