Hello Anbaesivam,
I think Asp.Net Membership and Role Manager can achieve it as you wish.
Please check the following reference:
http://weblogs.asp.net/scottgu/archive/2006/05/07/ASP.NET-2.0-Membership-and
-Roles-Tutorial-Series.aspx
In following reference, you can get some helpful samples of it:
http://www.dotnetjunkies.com/QuickStartv20/aspnet/doc/security/membership.as
px
The following link is about "Authorizing Access to a Page with Role
Manager" that is what you need I think.
http://www.dotnetjunkies.com/QuickStartv20/aspnet/doc/security/membership.as
px#auth
Furthermore, I will make a sample for you.
For example, I created two roles("user" and "admin") and there are two
folders(securedfolder and adminfolder) in the application.
1. The anonymous users can't access any pages in "securedfolder" or
"adminfolder" folder.
2. The managed users with "user" role can only access the pages in
"securedfolder" folder, but not for "adminfolder" folder.
3. The managed users with "admin" role can access any pages in the
application.
After deploying Membership and the roles for users, we need configure the
authorizing access to a folder in Web.Config.
<configuration>
<location path="securedfolder">
<system.web>
<authorization>
<deny users="?"/> <!--deny any anonymous
users-->
<allow users="*"/> <!--allow any managed
users-->
</authorization>
</system.web>
</location>
<location path="adminfolder">
<system.web>
<authorization>
<allow roles="admin"/> <!--allow any users
with "admin" role-->
<deny users="*"/> <!--deny any
anonymous/managed users-->
</authorization>
</system.web>
</location>
</configuration>
To redirect to the login page if authentication is not successful, please
deploy the following code in section "system.web" in Web.Config.
<authentication mode="Forms">
<forms name=".ASPXUSERDEMO" loginUrl="login.aspx"
protection="All" timeout="60"/>
</authentication>
Sincerely,
Vince Xu
Microsoft Online Support
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
MSDN Managed Newsgroup support offering is for non-urgent issues where an
initial response from the community or a Microsoft Support Engineer within
2 business day is acceptable. Please note that each follow up response may
take approximately 2 business days as the support professional working with
you may need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½