ASP.NET membership by default redirects user to a login page, however I like to handle login from everypage using ajax form that I already implemented.
How can I have membership enabled on my website and also able to access all pages in my website without being redirected to login page.
I’m using C# on visual studio 2010
Thanks in advance
Although Darin pointed me to a blog that has the correct answer but it is too complex.
I found an easier method to achieve what I needed. I modifed web.config fie to add a few allowed folders and files. here is how:
All my Ajax responses are in a single folder like
So I can modify
web.configand following rules to itin
system.websection I addedthis will forbid unauthenticated users from accessing the website
and in
configurationsection I addthis will allow unauthenticated users to access defaut.aspx and ajax folder.
obviously the login form also will be available to users if it is set in
system.web->authenticationremember to remove the web.config file located in account folder that is overriding the access to folders and files.