User Roles Using Web Config file [Resolved]

Posted by Jaypalsinh under Regular Expressions on 7/5/2011 | Points: 10 | Views : 6746 | Status : [Member] | Replies : 4
hi,
How to create User Roles using web config file??




Responses

Posted by: Yogi1990 on: 7/5/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
<system.web>
<authorization>
<allow roles="Admin" />
<deny users="*" />
</authorization>
</system.web>

You can use this also....

Yogi

Jaypalsinh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Yogi1990 on: 7/5/2011 [Member] Starter | Points: 25

Up
0
Down
Try this code in Web.config.


<configuration>
<system.web>
<authentication mode="Forms"> <forms name="MyPage.ASPXAUTH"
loginUrl="login.aspx"
protection="All"
path="/"/>
</authentication>
<authorization>
<allow users="*" />
</authorization>
</system.web>
<location path="administrators">
<system.web>
<authorization>
<!-- Order and case are important below -->
<allow roles="Admin"/>
<deny users="*" />
</authorization>
</system.web>
</location>
<location path="users">
<system.web>
<authorization>
<!-- Order and case are important below -->
<allow roles="User"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
</configuration>

Yogi

Jaypalsinh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Susanthampy on: 7/5/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,

Refer this links,

http://msdn.microsoft.com/en-us/library/ff647401.aspx
http://www.4guysfromrolla.com/articles/032807-1.aspx

Regards,
Susan

Jaypalsinh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakn2 on: 7/5/2011 [Member] Starter | Points: 25

Up
0
Down
try this

http://webconfigroles.codeplex.com/

Thanks&Regards
LakshmiNarayana Nalluri.

Jaypalsinh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response