|
Hi,
I have a website mydomain.com and I have few pages under this domains requires authentication which are the member's area pages but NOT all pages under this domains needs authentication.
I added the following to web.config:
<authentication mode="None">
<forms loginUrl="~/Signin" timeout="2880" />
</authentication>
then in the signin page, i added this:
FormsAuthentication.Authenticate(txtEmailAddress.Text.Trim(), txtPassword.Text);
and the following in the pages where I need it to be authenticated:
if (!HttpContext.Current.User.Identity.IsAuthenticated) FormsAuthentication.RedirectToLoginPage();
when I sign it should go to the home.aspx page where I placed the IsAutehnicated but it's going back to the sign page? why is this?
Regards,
Jassim
Technology News @ www.JassimRahma.com
|
|
|
|
|
This is not the direct answer to this question but looking at this article and the attached source code, I think your problem will be fixed:
Understanding and Implementing ASP.NET Custom Forms Authentication[^]
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
|
|
|
|