-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: vishnuvr
Message 1 in Discussion
Hi guys, Iam using forms authentication to my project, in the login page While
authenticating a user iam creating a FormsAuthenticationTicket Just like this string
strUserName = txtUsername.Text; string strUserPwd = txtPassword.Text; bool blnUA =
AuthenticateUser(strUserName,strUserPwd); if( blnUA == true) {
if(chkRemberLogin.Checked) // Checking whether Remember checkbox clicked. { //creating
cookie for Username and password cookieLoginName.Value = strUserName;
cookieLoginName.Expires = DateTime.Now.AddYears(1);
Response.Cookies.Add(cookieLoginName); cookiePwd.Value = strUserPwd; cookiePwd.Expires
= DateTime.Now.AddYears(1); Response.Cookies.Add(cookiePwd); // Create a custom
FormsAuthenticationTicket containing // application specific data for the user.
FormsAuthenticationTicket ticket =new FormsAuthenticationTicket(1,// Ticket version
strUserName, // Username associated with ticket
DateTime.Now,// Date/time issued
DateTime.Now.AddYears(1),// Date/time to expire
true,// "true" for a persistent user cookie
"CustomData", //User-Data
FormsAuthentication.FormsCookiePath);// Path cookie valid for
// Hash the cookie for transport
string strCookieval = FormsAuthentication.Encrypt(ticket);
// Create and add the cookie.
HttpCookie cookie = new HttpCookie(
FormsAuthentication.FormsCookieName,// Name of auth cookie
strCookieval);//Hashed ticket
// Add the cookie to the list for outgoing response
Response.Cookies.Add(cookie);
// Redirect to requested URL, or homepage if no previous page requested
string returnUrl = Request.QueryString["ReturnUrl"];
if (returnUrl == null) returnUrl = "/";
// Redirect back to original URL.
Server.Transfer(FormsAuthentication.GetRedirectUrl(strUserName,true));
}
my problem over is When the user succesfully authenticated
FormsAuthentication.GetRedirectUrl(strUserName,true) is always redirecting it to
default.aspx, but i want it to be different that too in different path, how can i over
ride this default property... any help on this will be appreciated
Regards
Vishnu
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/BDOTNET/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]