Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FormsAuthentication class

Status
Not open for further replies.

g2000

Programmer
Aug 31, 2005
39
0
0
US
Once user has been authenticated, he/she will be directed to a page.
I mean ...

FormsAuthentication.RedirectFromLoginPage(loginName, persistentState)
and
<authentication>
<forms .... ... loginUrl="login.aspx" ... />
</authentication>

I go to the browser and type login.aspx in address bar. Upon successful login, I am directed to default.aspx. Is that possible to change that
page(such as default2.aspx)? Thank you.
 
The user is being redirected to default.aspx as their is no ReturnURL querystring:


I suppose you could redirect back to the same page and add the querystring value yourself.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
When redirected to a forms login there is a querystring param named "ReturnUrl".
After successful authentication in your login page do this:

If Request("ReturnUrl") = Nothing then
Response.Redirect("default2.aspx")
else
Response.Redirect(Request("ReturnUrl"))

end if
 
I've read something about
FormsAuthentication.GetRedirectUrl(userName, createCookie).

First of all, how to use that? Anyone?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top