How can I access UserId
in ASP.NET Membership without using Membership.GetUser(username)
in ASP.NET Web Application Project?
Can UserId
be included in Profile
namespace next to UserName
(System.Web.Profile.ProfileBase
)?
Try this:
MembershipUser CurrentUser = Membership.GetUser(User.Identity.Name);
Response.Write("CurrentUser ID :: " + CurrentUser.ProviderUserKey);