ASP.NET Roles and Membership -


i quite new asp.net technologies

<configuration>     <system.web>       <authorization>         <allow roles="agency,admin"/>         <deny users="*"/>       </authorization>     </system.web> </configuration> 

i have above web.config folder, there requirement give elevated priviledge users in agency role access page called addorganisation.aspx. solve this, think can add following markup web.config static

<location path="addorganization.aspx">     <system.web>       <authorization>         <allow users="wale, etc, etc"/>         <deny users="*"/>       </authorization>     </system.web>   </location> 

how can enable adding users programmatically instead of updating web.config each change?

i grateful responses. thank you

you should not make changes web config @ runtime, restart application, every time add user. msdn says this

configuration changes cause restart of application domain

changes configuration settings in web.config files indirectly cause application domain restart. behavior occurs design. can optionally use configsource attribute reference external configuration files not cause restart when change made. more information, see configsource in general attributes inherited section elements.

instead should give users different role, users can access "addorganisation.aspx" page.

or else can thing if dont want create role these users. keep on adding these users table , whenever request made page can check if users name present in table or not , allow/deny user.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -