shepherdweb.com

ASP.NET Membership Provider Gotcha!

January 12th, 2007

It turns out that MembershipUser.UserName is a read only property, there is no Set { } method in the Membership Provider, only Get { }. If you try to use Membership.UpdateUser() to change an existing username, you will get the following error:

CS0200: Property or indexer ‘System.Web.Security.MembershipUser.UserName’ cannot be assigned to — it is read only

Is there any easy way around this? I’m sure there is a good reason why Microsoft did this, but why?

I found a potential solution in the ASP.NET Forums.

Technorati Tags: ,

No Comments »

No comments yet.

Leave a comment

RSS feed for comments on this post.

TrackBack URI

Bad Behavior has blocked 836 access attempts in the last 7 days.