In ASP.NET how can I absolute admission to assertive directories to alone users who accept logged in with altered roles? For example, how can I absolute admission to Admin/, Customer/ and Client/ directories to users who accept logged in with those roles?
ASP.NET provides able-bodied URL-based allotment capabilities acceptance you to ascendancy admission to directories by users, roles and alike by HTTP verbs (GET, POST, and so on).
First, you charge to set up your appliance to use either Forms or Windows affidavit and configure the arrangement to accept three altered roles: Admin, Customer and Client. In Windows affidavit these will map to user groups and in Forms affidavit those groups charge be set up manually. See “Forms Affidavit differences in ASP.NET 2.0” for added advice on the disparities in Forms affidavit amid ASP.NET 1.1 and ASP.NET 2.0.
Once you accept your Web appliance set up to accredit users, you charge to acquaint ASP.NET to crave specific allotment in adjustment to admission resources. Web.config files accumulation agreement advice for the agenda in which they are amid and all assets beneath them. By ambience up a able <authorization> tag in the web.config book you can ascendancy what users are accustomed admission to the directories.
To acquiesce admission alone to users with the Admin role for the Admin/ directory, the <authorization> tag should be set up as follows:
<allow roles=”Admin” />
<deny roles=”*” />
This will acquiesce users with a role of Admin to admission files in the Admin/ agenda and will abjure all others.
Here is a abundant MSDN advertence commodity with added specifics and syntax advice for URL authentication.
How You Can Attend Asp Net Web Forms Application Tutorial With Minimal Budget | Asp Net Web Forms Application Tutorial – asp net web forms application tutorial
| Encouraged to be able to my own weblog, with this moment We’ll provide you with with regards to asp net web forms application tutorial