SIGN UP MEMBER LOGIN:    
ARTICLE

How We Can Use Custom Roles And Membership in ASP.NET

Posted by Dorababu M Articles | ASP.NET Programming July 13, 2011
In this article I would like to show a sample demonstration regarding how we can use a custom roles and membership.
Reader Level:
Download Files:
 


In this I created and attached my sample database in the APP_DATA folder, in which you can find all the sample tables and stored procedures I used.

This article also covers how to lock a user based on the invalid attempts he made. As per the demonstration I set the maximum value to 3. When the user is locked he will not be able to access his account until and unless he is unlocked by admin.

Page level access for the roles assigned is also covered in this article. The user that has no permission to view the page will be restricted.

Login using the following credentials

User Name

Password

Role

Pages to be Accessed

Dave

dave@123

DistrictAdmin

 LEPstudentrecords.aspx, Campus.aspx

Jennifer

jennifer @123

CampusAdmin

Campus1.aspx, LEPstudentrecords.aspx

dorababu

dora@123

LPACMember

LEPstudentrecords1.aspx

Reddy

reddy@123

Teacher

Teacher.aspx


Sample Pages:

MemShipCus1.gif

Admin page:

MemShipCus2.gif

Clicking Locked Accounts will take you to the page where you can see all the Locked Accounts.

Admin can unlock the accounts by selecting each one individually.

MemShipCus3.gif

Afer selecting a user or users and clicking on Unlock, the user(s) willl be able to access their account again.

MemShipCus4.gif

If you logged in as some other ROLE and tried to access the pages which were not under his ROLE, the corresponding page is shown as below:

MemShipCus5.gif

I haven't designed the pages up to the fashion.

Code used for this approach is attached.

If any doubts regarding the article please feel free to ask.

Login to add your contents and source code to this article
share this article :
post comment
 

I did not get you just based on the roles i have given access to that pages. I have not maintained any column in DB related to the page

Posted by Dorababu M Aug 17, 2011

hi this one very gud but in above artical u r given username pwd and role pages to acessed columns there right. u r given database right in that how i find out pages to accessed column please tell me dat one this is my mail id srnaidu.net@gmail.com

Posted by ramesh samarla Aug 17, 2011

Ok cool

Posted by Dorababu M Jul 14, 2011

ya

Posted by Angelina Erin Jul 14, 2011

Thanks have you tested my code

Posted by Dorababu M Jul 14, 2011
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
Team Foundation Server Hosting
Become a Sponsor