我正在使用 aspnet_Profile 表,它在本地运行,但是当我将它推送到开发环境并在那里运行它时,它会ProfileBase.Create(user.Username)
返回一个空值。
var user = Membership.GetUser(Username);
不为空并返回一个用户,所以我不确定为什么要返回一个空值ProfileBase.Create
。
有任何想法吗?
var user = Membership.GetUser(Username);
var ext_user= ProfileBase.Create(user.UserName) as UserProfile;
ext_user.Name = Name;
ext_user.Save();
public class UserProfile : ProfileBase
{
public static UserProfile GetUserProfile(string UserName)
{
return Create(UserName) as UserProfile;
}
public string NameExtended
{
get { return base["NameExtended"] as string; }
set { base["NameExtended"] = value; }
}
}