Click to See Complete Forum and Search --> : FormsAuthentication question
MrPolite
Jul 15th, 2004, 11:20 PM
I'm using FormsAuthentication.RedirectFromLoginPage() and I dont have a default.aspx page for my application. So if I open a new browser window and go to the login page, it tries to go to the default page and I get an error. Is there any way to define a default page for the redirection?
Fishcake
Jul 16th, 2004, 04:56 AM
You can check if returnURL parameter exists and if it doesn't set an authentication ticket and redirect to a page of your choosing instead.
If Request.Params("ReturnURL") Is Nothing Then
FormsAuthentication.SetAuthCookie(strUsername, False)
Response.Redirect("Main.aspx")
Else
FormsAuthentication.RedirectFromLoginPage(strUsername, False)
End If
MrPolite
Jul 17th, 2004, 11:40 PM
Originally posted by Fishcake
You can check if returnURL parameter exists and if it doesn't set an authentication ticket and redirect to a page of your choosing instead.
If Request.Params("ReturnURL") Is Nothing Then
FormsAuthentication.SetAuthCookie(strUsername, False)
Response.Redirect("Main.aspx")
Else
FormsAuthentication.RedirectFromLoginPage(strUsername, False)
End If Thank you!:afrog:
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.