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



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.

Up Next
    Ebook Download
    View all
    Learn
    View all