Click here to Skip to main content
15,896,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have read a lot of articles on SqlMembershipProvider and SqlRoleProvider, but i think is still does not meet-up with my requirement or maybe i am not getting something straight in it.
I have created a registration page an a login page for user of the website, Two roles are also created (Administrator and Standard Role) the administrator role control other users and roles. I tried using the LoginControl and the CreateUserWizard control in ASP.NET but after i have use (aspnet_regsql.exe utility), the tables that are created does not meet-up with what i want. Like the column in my web application has something like (Company_Name, Company_Id, Home_Address e.t.c) but the tables dont have such columns in them.

--- How can i implement Member and Role in my Application ---
Posted

1 solution

You can customize CreateUserWizard control look at this article:
http://www.4guysfromrolla.com/articles/070506-1.aspx#postadlink[^]
 
Share this answer
 
Comments
ahmedfaruk88 8-Jul-11 13:06pm    
If i customize the create user wizard and add more controls like (Company_Name, Company_Id, Home_Address e.t.c). it means i will have to edit the underlying table (aspnet_Users) table to accommodate the it. Or what am i to do
Parwej Ahamad 8-Jul-11 22:01pm    
See the below Philippe Mori comment.
Philippe Mori 8-Jul-11 21:58pm    
You can also create another table with a column for the UserId and any custom fields. You can then set the relationship between the table so that deleting a row from aspnet_Users will CASCADE DELETE. When adding a user, that new table can also be filled. You might wnat to add some code to ensure that if adding a user in your table fails, then aspnet_Users table won't have that user and vice-versa. In my case, I have used a TransactionScope for that purpose. In that case, you have to ensure that the Distributed transaction coordinator service is running when running the application from Visual Studio integrated server.
ahmedfaruk88 25-Aug-11 9:37am    
Please can you give a guideline on how to ensure that if adding a user on the table fails then or a field is not inserted in the other table that referenced the aspnet_Users table then the creation of user in the aspnet_users table should be rolled back.

Thankss

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