Rakesh Sawant
Rakesh Sawant

Reputation: 69

Membership.CreateUser with custom fields

In asp.net i am using Membership where i have used Membership.CreateUser(login, password, email, null, null, true, out status); But I've the requirement where i want some more info from user such as Contact no and Short name

System has created tables for membership using aspnet_regsql.exe But i've above requirement with more custom column

How i can store them

Do i modify those table but at a same time Membership.CreateUser has only limited entities Please help

Upvotes: 0

Views: 197

Answers (1)

Jason Meckley
Jason Meckley

Reputation: 7591

you could use the asp.net Memberhip Profiles. but I find it to be very limiting. For my last project, I created a separate table with specific columns to hold the extra data. the PK was the username. then I would simply query for the custom properties.

var profile = context.Set<Profile>().Find(User.Identity.Name);

You may also want to take a look at the Universal Membership Provider. It's much more flexible than the asp.net membership provider.

Upvotes: 2

Related Questions