.net - how to use UserId instead of user name in authentication ( Web Forms asp.net)? -
itemprop = "text">
I have Visual Studio 2013 Last I have created ASP.NET Web App (not MVC) .NET Framework 4
User Primary key is uniqueidentifier (GUID) with Forms, I found dafault Login.aspx, Register.aspx and other forms. There are codes using User.Identity.Name instead of the primary key User ID:
as a result of the default = OpenAuth.GetAccountsForUser (User.Identity.Name) form. The main GUID of this user.Identity.Name to change, because more than two users can have the same name?
"itemprop =" text "> ASPNET membership
You are using providers:
subscription user User = membership GetUser (User.Identity.Name); Guid guid = (Guid) user.ProviderUserKey;
In the case of OHTH you do this.
You should add `[InitializeSimpleMembership] 'at the top of the controller class if you use another controller in comparison to the AccountController. WebSecurity.GetUserId (User.Identity.Name);
Also check this answer:
Comments
Post a Comment