asp.net Membership - 设置注释字段

时间:2009-09-04 20:45:24

标签: asp.net-membership

以下代码未设置注释:

string userName = "yrtre.etre.423369a9-3e57-42da-934d-dae91f87a1e4";
MembershipUser user = Membership.GetUser(userName);
user.Comment = "Test";

我也不例外。有什么想法吗?

1 个答案:

答案 0 :(得分:17)

您需要调用UpdateUser来存储更改。

string userName = "yrtre.etre.423369a9-3e57-42da-934d-dae91f87a1e4";
MembershipUser user = Membership.GetUser(userName);
user.Comment = "Test";
Membership.UpdateUser(user);