Using ASP.NET 2.0 log in controls - Creating the first user

M

Matt Adamson

Guys,

I'm thinking of using the various log in controls ASP.NET 2.0 provides e.g.
the CreateNewUserWizard. However my first question is how do I get a new
user into the system initially to actually log in and create new users?

Should I use SQL to directly insert a user record into the aspnet_Membership
and aspnet_User tables or use the API to create a new user with an admin
type role?

Best Regards

Matt
 
M

Matteo Migliore

Hi!
I'm thinking of using the various log in controls ASP.NET 2.0 provides
e.g. the CreateNewUserWizard. However my first question is how do I get a
new user into the system initially to actually log in and create new
users?

You can create a new user through the CreateUserWizard control or
the "Administrative Application" from VS2005, "Website - ASP.NET
Configuration".
> Should I use SQL to directly insert a user record into the aspnet_Membership
and aspnet_User tables or use the API to create a new user with an admin
type role?

Yes, you can call directly the store procedure of the ASPNETDB database:
SqlCommand command1 = new SqlCommand("dbo.aspnet_Membership_CreateUser",
holder1.Connection);
(use Reflector to get the complete code)

You can create a user by code using this code:
Membership.CreateUser(...);

To manage rules you should use the same tool, the "Administrative
Application" provided by
VS2005.
Best Regards
Matt

Matteo Migliore.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top