Friday, March 16, 2012

Log-in page redierct question

Hi,

I'm trying to write a simple log in page. I followed the instructions on this site http://www.asp.net/webmatrix/tour/section9/createloginpage.aspx
It says that by default, the Login page will redirect the user to a page named Default.aspx on a successful login. How can I change the return Url to something other than default.aspx?

ThanksSet your authentication ticket then use response.redirect()
Example:

FormsAuthentication.RedirectFromLoginPage(UserEmail.Value, PersistCookie.Checked);
I'm sorry, I'm just new at this...

How do I set my authentication ticket?


IF (''USERNAME/PASSWORD WERE VALID'') THEN
FormsAuthentication.SetAuthCookie(txtUserName.Text, false)
Response.redirect("UserAdmin/index.aspx") 'Protected directory
ELSE
lblError.text = "Invalid User name or Password!"
END IF

Thank you!

0 comments:

Post a Comment