Click here to Skip to main content
15,918,516 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i wanted to use login form and create user wizards but the login controls provided in toolbox makes me to confuse.so i created the table by my own like below

ID UserName(PK) Password Email SequerityQuestion Answer Role
1 krishna windows@ krishna@yahoo.com your partner ? Microsoft Admin
2 suresh billgates@ suresh@yahoo.com your partner ? Google Employee

now i can able to read the username and password and assign them to Forms Authentication
but the problem is with Role i wanted to assign Role to the Forms authentication role

i think it may like below

string role=(value obtained from database;
User.Identity.RoleName=role;
Posted
Updated 28-Aug-11 21:34pm
v2

1 solution

Hi one of my friend given me fallowing Response i still getting error
i tried like below

trail 1:
Roles.AddUsersToRole(User.IdentityName,role);

trail 2:
Roles.AddUsersRole(TextBoxUserName.Text,role);

trail 3:
Roles.AddUsersToRole("suresh","Employee");

but i am getting the error below:
The Role was not found.

Note :
Here role is
string role=(value obtained from database);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900