We help IT Professionals succeed at work.

asp.net programatically add <location> to app.config

glenn_r
glenn_r asked
on
I have a role I've created thru the WSAT named Managers. I've added the following to the app.config to restrict access to users who are in the Managers role.

 <location path="Management">
        <system.web>
            <authorization>
                <allow roles="Managers"/>
                <deny users="*"/>
            </authorization>
        </system.web>
    </location>

Where that was manual and done at design time. How and I add the location\authorization to the app.config at runtime. I see a method in the roles object that lets me add a role programatically is something available to add an authorization?
Comment
Watch Question

Web Developer
CERTIFIED EXPERT
Commented:
Check out link:

http://www.codeproject.com/KB/cs/SystemConfiguration.aspx

The article let you know how you can modify the app.config programatically.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.