how to set the permission for pages to different users in asp.net c#?

Posted by Prabu_Spark under ASP.NET on 2/25/2013 | Points: 10 | Views : 2185 | Status : [Member] | Replies : 2
Hi sir,
I need the code to set the permission for pages to different users in asp.net c# without using membership concept.
Kindly give me the solution for this problem.


[Hint: Only "administrator" roles can access all the pages, while the users have limited permission to visit the particular pages]

With regards,
J.Prabu.
[Email:prbspark@gmail.com]



Responses

Posted by: Ankitsrist on: 2/25/2013 [Member] Starter | Points: 25

Up
0
Down
hello please find attached sample authentication app, may be it will help u
 Download source file

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

Posted by: Raja_89 on: 2/25/2013 [Member] Starter | Points: 25

Up
0
Down
Hai Techie

You can do your action by following types
1.Based on the username and password and role selected by the user
2.By assign the roles


In web.config

Code:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<authorization>
<allow roles="Raja" />
<allow roles="Admin" />
<deny users="*" />
</authorization>
</system.web>
</configuration>

Where

deny users ="*" means deny others except those are in allow [raja,Admin]
deny users="?" unauthenticated users




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

Login to post response