How to tune ASP.NET CreateUserWizard? - asp.net

I have created ASP.NET WebForms site on IIS 7.5. I want to create step by step user registration. I want to store the basic and detailed information about registered users in a specially created database table (not in aspnet_users table). I want to validate email first and then prevent next registration step for the user whose email address already exists in the database. At the last registration step I want to present summary form. All previous input and select fields should be duplicated in this form with "disabled" attribute.
Please tell me how to adjust CreateUserWizard ASP.NET Control and web.config file to these needs?

You can add steps to CUW as shown here:
Customize CUW
Storing Additional Information
Show Summary of user registration
For verification you can set requiresUniqueEmail="true" in your membership element:
Your have several requirements in one question. It would have been better if you had split into different questions.

Related

Extending User information inside asp.net mvc 5 project

I have created a new asp.net MVC-5 web application , and I define individual user accounts as the authentication type.
Now when users register a new account they can enter email and password. Now I want to extend the users information when registering their account as follow:-
First name
Last name
Data of birth
Country
City
Address
Etc…
Now I am not sure what is the recommended way to extend the user info. Now I am trying to do the following 2 steps, as when the project was created a new database has been created automatically and it has a table named “ASPNETUSers”, which store the users info.
So I am thinking of adding the additional fields inside this table.
Then to modiy the “Account >> Register” view to render the additional fields.
So can anyone advice if my above 2 steps to store additional info about the users upon registration is valid ?or I should not modify the built-in database tables which include the ASPNETUSers ??

Role Provider In ASP.net

I have these roles:Admin, Doctor and Patient. But login information is stored in different table. Admin's username and password are stored in User_TABle(They are two items). Patient's Login information is stored in Patient_TABLE: PatientID, Year and DocumentID(They are three items). I want to use SQLRoleProvider and SQLProfileProvider. How can I design different login page with loginView?
Sincerely yours
I think a better setup would be this:
Use the standard MembershipProvider shipped with ASP.NET to use in conjunction with RoleProvider. Once this is setup and you have the roles you can store personal information for each either by:
Using ProfileProvider (not a bad method but requires a bit of work as you have polymorphic data (you would store it using XML in text field of the provider or write your own custom profile provider)
OR
Add a table similar to your schema but with a foreign key to the aspnet_Users PK. In code then you could do Roles.IsUserInRole("Whatever") and change the loginView appropriately. It would also mean you could just drag and drop the remaining LoginControl etc and have it just work with the standard membership provider
SqlRoleProvider, SqlProfileProvider and SqlMembershipProvider come with default Aspnetdb.
To create the database used by these providers, run the aspnet_regsql.exe executable found in the C:\WINDOWS\Microsoft.NET\Framework\ versionNumber folder. Otherwise, you have to create CustomRoleProvider, CustomProfileProvider and CustomMembershipProvider.
http://msdn.microsoft.com/en-us/library/system.web.security.sqlroleprovider.aspx

ASP.NET WAP, register user with manual approval

I'm new to ASP.NET.
On a web site, I want users to be able to register, their input data to be saved in a database, but their login should not be functional until their data has been reviewed and potentially approved. The database would then be updated with a new entry with their login and details.
I think it makes sense to have the registration details and the user details as separate tables. As the user details will have many additional fields. So registration and login should connect to different tables.
Does this sound sensible? And would I in this case have any benefit from using the CreateUserWizard and Login controls? Will it allow me to specify the custom database and fields for handling registration data and user status?
If not, it would be nice if you could give some rough steps on how I should approach this "manually"..
You can do this using ASP.Net Membership object, once user is created make sure you override IsApproved property to 1, this will stop user from login in until you review it and set IsApproved property = 0.

How to track and load a specific user's information?

I'm making a small portal in ASP.net (with C#.net4) where users can login and add, edit their personal information (PI). But I don't get how to load information (stored in a SQL server DB) in the page when a specific user is logged in.
For example: If Sam is logged in, he can view his PI. When Vicky is logged in, she can view her PI.
who can help me with this?
thanks in advance.
You need to retain the ID of the logged in user in a session variable and then use it to filter the query with which you fetch each user's info.
So if a user's ID is 278 then your query would run as:
SELECT first_name, last_name, * FROM user_table WHERE user_id = 278
From a session variable stored like:
Session["UserId"] = currentUserId;
The ASP.NET membership provider has already taken care of this for you. Have you considered using it? You can manage all of your authentication, permissions, roles, and access/edit profile information -- which you define. You access the data via the membership objects, and you won't need to write a single line of SQL to do it. It will save you loads of work instead of trying to reinvent the wheel.
Use the regular membership as described in the other answers. Then leverage the Profile system so that each user can view/edit their info when logged in (per the question). CAVEAT: ASP.NET profile system only works out of the box with the Website project template. If you want to use the Web Application project template, then follow the steps here:
ASP.NET: Web Site versus Web Application Project
When you have the profiles up and running, the profile data can be stored in session objects while the user is logged in.

Persist custom registration information with Profile API

I've seen examples of producing a custom registration control which persists its information with some extra fields (or a table depending on the problem) in the corresponding Sql Server.
It's also said that there is a way to do the same thing with the Profile API (persist custom info in a registration control). Is there a walkthrough for this?
Thanks
Check out this link from MSDN Storing User Information with ASP.NET 2.0 Profiles
You'll also need to know how to Create the Application Services Database for SQL Server

Resources