ASP.NET Membership Provider Gotcha!
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.
Filed under: ASP.NET by Shane |
Comments (0)
No Comments »
No comments yet.