One of my friend has the problem using for accessing the page and folder using the form authentication. I thought I should put this solution in the blog. Whenever we use the Form Authentication for the authentication we use the following configuration in the web.cofig file
<authorization>
<deny users="?"></deny>
</authorization>
<authentication mode="Forms">
<forms name="MyAuthAsp" defaultUrl="default.aspx" loginUrl="login.aspx" cookieless="AutoDetect" path="/" protection="All" timeout="20"/>
</authentication>
here <authorization>
<location path="Default.aspx">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
Now the Default.aspx page will be accessable by the anonomous users withoug login. If you want to access more pages then add that section with the differenct path.
<location path="style.css">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
If you have to access a folder or all the pages of a particula folder then you can specify the folder path here.
<location path="MyFolder">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
No comments:
Post a Comment