开发者

MembershipUser class - Comments method doesn't work?

开发者 https://www.devze.com 2023-01-25 02:41 出处:网络
I\'m unable to set the Comments property of a MembershipUser object. For example: MembershipUser mu = Membership.GetUser(username);

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 开发者_Go百科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...?


Call Membership.UpdateUser(mu).


I am not too familiar with Membership, but I would assume that you would need to actually save the changes, by calling Membership.UpdateUser:

MembershipUser mu = Membership.GetUser(username);                         
mu.Comment = "someComments"; 
Membership.UpdateUser(mu);
0

精彩评论

暂无评论...
验证码 换一张
取 消