Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Thursday, January 5, 2012 7:40 PM
Hello !
While using login control , i want to open some page without authentication.
Only some specific page should ask for login.
Other should be opened without login also.
How can i do this ?
All replies (3)
Thursday, January 5, 2012 9:37 PM ✅Answered
Hi,
you need to use Authorization ,and deny anonmouse user to Access some pages ,and i recommended you putting them in one folder ,and then deny access to that folder,
All files amd folers is allowed by default , so you don't need to give the Other pages allow Permission.
http://msdn.microsoft.com/en-us/library/wce3kxhd.aspx
http://www.4guysfromrolla.com/articles/031204-1.aspx
http://www.asp.net/web-forms/tutorials/security/roles/role-based-authorization-cs
Hope this Helps
Sunday, January 8, 2012 7:15 AM ✅Answered
I found a solution.
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="Default.aspx" defaultUrl="p1.aspx" >
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
</system.web>
<location path="p2.aspx"> <system.web>
<authorization>
<allow users="*"/> </authorization>
</system.web>
</location>
</configuration>
Sunday, January 8, 2012 6:54 AM
Hello !
your link is helpful .
Article shows that we need create a folder and then for each folder we can give permission to user.
But is there any other way without creating folder ?
for example , May be some editing in web.config only.