Reading A User's ASP.NET Profile

One frequent question is: how can we read a user's profile properties (ASP.NET Profile Provider)? The answer is simple, we use class ProfileBase:

//a specific user
ProfileBase profile = ProfileBase.Create("username", true);

//all users
BaseProfile [] profiles = Membership.GetAllUsers().Cast().Select(u => ProfileBase.Create(u.UserName, true)).ToArray();

Bookmark and Share

                             

No Comments

Add a Comment

As it will appear on the website

Not displayed

Your website