Click here to Skip to main content
16,021,621 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I want give folderwise auhtentication in asp.net.. by using coding only. pls help me to explain deeply..
Posted
Updated 3-Sep-11 1:46am
v3
Comments
RaisKazi 3-Sep-11 7:47am    
Be formal while using terms after "Hi".

Assuming you are using Membership[^] and Role[^] Providers, all you need to do is set the appropriate permissions in the folders web.config:
XML
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.web>
        <authorization>
            <allow roles="Admin" />
            <deny users="*" />
        </authorization>
    </system.web>
</configuration>


If you are determined to do it yourself, then have a look at Membership Providers and Role Providers - these are similar in effect to the default ones, but you code them yourself. They are certainly the easiest way to do it, the alternative being to reinvent the wheel in your master page Load event - a lot more work.
 
Share this answer
 
Comments
koolprasad2003 3-Sep-11 8:06am    
Yes, URL autorization will help to get solution.+5
Jayname 3-Sep-11 8:12am    
thanks
 
Share this answer
 
Comments
Jayname 3-Sep-11 8:09am    
Thnaks You....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900