Question

Will someone please tell me how to create a user without using membership.createuser() and create user wizard in asp.net? I need to perform an additional insert on an existing table during CreateUser().

Was it helpful?

Solution

Here are two ways to go:

Implement your own custom membership provider. This is easier than you think and pretty straight forward. There are plenty of articles around.

or

To save you some time... implement your own custom membership provider and inherit from the SqlMembershipProvider class. In the subclass you will mostly just "forward" the calls to the base class except for in the CreateUser method. In this case you can let the base class do most of the work and then perform your custom insert. However, since it does need to be in one transaction (per your comment above) then things might be a little hairy... and you would possibly have to reimplement the CreateUser method in your subclass.

http://msdn.microsoft.com/en-us/library/system.web.security.sqlmembershipprovider.aspx

Note: I am on a bus right now via Wifi, but I am almost tempted to write this for you if you include the emp_details schema for me. Are you using straight ADO.NET or something else?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top