Configure webcontrol properties through Web.Config?

H

Haris

Is it possible to configure webcontrol properties through Web.Config and
also to combine these with autorisation?

It would look something like this:

<location path="Admin">
<system.web>
<form id="newUser">
<control id="userRank">
<authorization>
<allow roles="administrator"/>
<deny users="*"/>
</authorization>
</control>
</form>
</system.web>
</location>


This would mean that only if a user has role of "administrator" he would
be able to see the control "userRank" in the form "newUser"





TIA
Haris
 
B

Brennan Stehling

Look at the Login controls.

http://msdn2.microsoft.com/en-us/library/ms178329.aspx

You may find the Login View control does part of what you want.
Otherwise, you can set the Visible property on any control based on
whether or not a user is in a role or not. To do that you need the
Membership and Role providers enabled.

You can see my configurations here...

http://brennan.offwhite.net/blog/2006/09/25/multiple-site-authentication-with-aspnet-20/
http://brennan.offwhite.net/blog/2006/09/25/robust-custom-profiles/


Brennan Stehling
http://brennan.offwhite.net/blog/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top