MembershipUser 类 - Comments 方法不起作用?
我无法设置 MembershipUser
对象的 Comments
属性。
例如:
MembershipUser mu = Membership.GetUser(username);
mu.Comment = "someComments";
我希望将 mu
对象的 Comment
属性设置为“someComments”并将更改写入数据库。
随后,我进行了以下检查:
mu.Comment == "someComments";
Comment
属性设置为 null。我需要在 web.config 中更改任何内容吗?或者...?
I'm unable to set the Comments
property of a MembershipUser
object.
For example:
MembershipUser mu = Membership.GetUser(username);
mu.Comment = "someComments";
I'd expect this to set the Comment
property of mu
object to "someComments" and write changes to the database.
Later, I do the following check:
mu.Comment == "someComments";
Comment
property is set to null. Is there anything that I need to change in a web.config or...?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
调用Membership.UpdateUser(mu)。
Call
Membership.UpdateUser(mu)
.我不太熟悉会员资格,但我假设您需要通过调用
Membership.UpdateUser
:I am not too familiar with Membership, but I would assume that you would need to actually save the changes, by calling
Membership.UpdateUser
: