Create User Profile

Here is the small snippet of code that writes profile properties from the CreateUserProfile.aspx page. It goes in the button click event handler, as shown on page 183 (in the English edition).

        Profile.FirstName=txtFirstName.Text;
        Profile.LasttName=txtLastName.Text;
        Profile.Address1=txtAddress1.Text;
        Profile.Address2 = txtAddress2.Text;
        Profile.City = txtCity.Text;
        Profile.StateProvince=txtStateProvince.Text;
        Profile.ZIPPostalCode=txtZipPostalCode.Text;
        Profile.Country=txtCountry.Text;

If you use Visual Basic rather than C#, you just have to remove the semicolon at the end of each line, as below:

        Profile.FirstName=txtFirstName.Text
        Profile.LasttName=txtLastName.Text
        Profile.Address1=txtAddress1.Text
        Profile.Address2 = txtAddress2.Text
        Profile.City = txtCity.Text
        Profile.StateProvince=txtStateProvince.Text
        Profile.ZIPPostalCode=txtZipPostalCode.Text
        Profile.Country=txtCountry.Text

These would actually be easy to type yourself, because the Intellisense kicks in as soon as you type Profile into the page.

Home