V
VR
Hi,
I am using Forms type of authentication, but having
problems redirecting users to default page after they get
authenticated.
My default page is default.aspx, but it's in 'public'
directory in realtion to my virtual directory:
"/public/default.aspx". In IIS I set the default document
to be "/public/default.aspx".
The problem is that once user is authenticated, ASP.NET
redirects him to "default.aspx" instead
of "public/default.aspx". MSDN says that "if there is no
original URL, Default.aspx is used" for
FormsAuthentication.GetRedirectUrl(...). How can I
customize the path to my default page?
Here is the code I use to authenticate a user and forward
him to the previously requested page:
FormsAuthenticationTicket oTicket =
new FormsAuthenticationTicket(szLogin, false, 1);
string szTicket =
FormsAuthentication.Encrypt(oTicket);
Response.Cookies.Add(
new HttpCookie(
FormsAuthentication.FormsCookieName, szTicket ));
string szURL =
FormsAuthentication.GetRedirectUrl(szLogin, false);
Response.Redirect(szURL);
Thanks,
VR
I am using Forms type of authentication, but having
problems redirecting users to default page after they get
authenticated.
My default page is default.aspx, but it's in 'public'
directory in realtion to my virtual directory:
"/public/default.aspx". In IIS I set the default document
to be "/public/default.aspx".
The problem is that once user is authenticated, ASP.NET
redirects him to "default.aspx" instead
of "public/default.aspx". MSDN says that "if there is no
original URL, Default.aspx is used" for
FormsAuthentication.GetRedirectUrl(...). How can I
customize the path to my default page?
Here is the code I use to authenticate a user and forward
him to the previously requested page:
FormsAuthenticationTicket oTicket =
new FormsAuthenticationTicket(szLogin, false, 1);
string szTicket =
FormsAuthentication.Encrypt(oTicket);
Response.Cookies.Add(
new HttpCookie(
FormsAuthentication.FormsCookieName, szTicket ));
string szURL =
FormsAuthentication.GetRedirectUrl(szLogin, false);
Response.Redirect(szURL);
Thanks,
VR