Transfering Pages

  • Thread starter Thread starter bshannon
  • Start date Start date
B

bshannon

I have an intranet site that uses a login. If a user
clicks a link that requires them to be logged in it will
check.

If a user is not logged in the page takes them to the
login page.

My Problem:
The user will now log in. How can I take the user back
to the page that required the login? I want the user to
go back to the page where they originally clicked the
link that searhed to make sure the user was logged in.

Any help would be appreciated.

Thanks
 
first, use something like this in your web.config
<authentication mode="Forms">

<forms name=".ASPXCOOKIEDEMO" loginUrl="/tracker/Default.aspx"
protection="All" timeout="20" path="/"></forms>

</authentication>


then in your login page....

if(Request.QueryString["ReturnUrl"] != null)

{

FormsAuthentication.RedirectFromLoginPage(UserID, false);

}

else

{


FormsAuthentication.SetAuthCookie(UserID,false);

Response.Redirect("/home/default.aspx");

}
 
Back
Top