alt
Advertisement
Sponsored links
Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow ASP.NET 2.0 arrow ASP.NET 2.0 Free Tutorials : Managing Membership and Roles
Site Search


ASP.NET 2.0 Free Tutorials : Managing Membership and Roles
Article Index
ASP.NET 2.0 Free Tutorials : Managing Membership and Roles
Page 2
Page 3
Page 4

Most of the methods of the Role class are directed towards querying for user roles. The role information is stored in an encrypted format in a cookie sometimes. When this happens ASP.NET checks for the cookie and decrypts the role ticket and attaches the role information to the User object. The cookie is valid only for the duration of the request for the current user. Other user information, if requested is read from the data store using configured role provider.

Cookie support can be enabled if the cacheRolesInCookie attribute is set to true in the Web.config file. It must be remembered that the Role class is really a string that represents and enables administration by its name. There is no direct relationship between the role class and membership management. The users are also administered as a string.

The Role Provider

Another feature of the Role assignment tools in ASP.NET is the Role Provider. The RoleProvider inherits from the RoleProvider class and the schema is not very different from the membership provider. Many of the methods used are similar the membership provider class in name and functionality.

ASP.NET comes with two built in providers AccessRoleProvider and SqlRoleProvider.

The Membership API and the Role Management API have really made the life of the web application developer easy. The API built around the concept of a provider, exposes a suite of methods that are not tied to physical data store. This is particularly useful in personalization. The interfaces also make the type of data store irrelevant because any kind of data store can be accessed through the provider.


Trackback(0)
Comments (1)add comment

Ghulam Abbas said:

  great for me. I was looking for this stuff..

I have learned alot.


Ghulam Abbas
July 24, 2007

Write comment

busy

 
< Prev   Next >
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape