我嘗試使用Membership.GetUser時出現錯誤。使用intellisense的.GetUser()只是不存在.... AddMember()是。我已經在使用System.Web.Security;幫助Membership.GetUser ASP.NET C#
下面兩個既不正在
protected void Page_Load(object sender, EventArgs e)
{
string userName = User.Identity.Name;
// Lets get the user's id
Guid userId = (Guid)Membership.GetUser(userName).ProviderUserKey;
MembershipUser user = Membership.GetUser(userName);
}
錯誤
The type or namespace name 'GetUser' does not exist in the namespace (are you missing an assembly reference?)