I want to change an existing user's profile without having to create a new profile for the user. For example: I have a user name Usr1
and I want to change only his age, how do I do that?
When you are in the page you have the ProfileCommon class available to you for accessing the profile. The profilecommon class is automatically generated by asp.net from you web.config profile settings during compilation of the web project.
In case you want to use the profile from app_code folder, you will have to use the profilebase class. Profilecommon that is available in the page also derives from this class.
Profilebase can be access like this
HttpContext.Profile or HttpContext.Current.Profile
To read a profile value you need to do the following
HttpContext.Profile.GetPropertyValue("propertyName");
To write a value to the profile you need to write
HttpContext.Profile.SetPropertyValue("propertyName", "propertyValue");