Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 3rd, 2007, 10:48 AM
Authorized User
 
Join Date: Apr 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to change the UserName in Membership

The below code is ok to update the Email in the membership

    MembershipUser currentUser = Membership.GetUser();
    currentUser.Email = NewEmail.Text;
    Membership.UpdateUser(currentUser);

I'd like to change the UserName of membership

    MembershipUser currentUser = Membership.GetUser();
    currentUser.UserName = NewUserName.Text;
    Membership.UpdateUser(currentUser);

There are some errors:
    "currentUser.UserName" is readOnly

How can I do?



 
Old May 3rd, 2007, 02:04 PM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to vantoko
Default

username is a readonly field so you actually cannot change it.
however, I found this via google and it seems a nice solution to me (havent tested it)

http://msmvps.com/blogs/omar/archive...18/108003.aspx

 
Old May 4th, 2007, 08:33 AM
Authorized User
 
Join Date: Apr 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks vantoko
Yes, I'v changed the username, but there are something leave in the user and profile tables.







Similar Threads
Thread Thread Starter Forum Replies Last Post
username and password abhi_loveu2002 ASP.NET 2.0 Basics 1 December 14th, 2006 05:25 AM
Get Username and system name in C# JelfMaria VS.NET 2002/2003 2 July 7th, 2005 06:01 AM
objNetwork.UserName Sebastiaan Classic ASP Basics 1 August 9th, 2004 11:10 PM
Username Changes Ben Horne Forum and Wrox.com Feedback 2 March 12th, 2004 12:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.