Working with the My Profile Web Part
The My Profile Web Part displays personal information about the shopper. The My Profile Web Part displays the required fields and information in a tabbed view, allowing the shopper to navigate to data grouped by personal information, shipping information, billing information, and addresses. The tabbed view is not rendered by the My Profile Web Part itself, but is rendered by a control in the ASPX code that houses the Web Part. The Personal Information section allows for editing of attributes such as first name, last name, date of birth, and so on. If you use a unique ID rather than an e-mail address as an identifier on the site, the shopper can enter an e-mail address at account creation and edit it later.
The My Profile Web Part is not responsible for creating a new profile, but only for editing an existing profile. The Registration Wizard Web Part creates a new profile. The My Profile Web Part also provides shoppers with a means to manage an account on a Web site by editing their personal information such as first name, last name, date of birth, and so on.
Other sections may be embedded or link from the My Profile section including My List, My Product Reviews, and My Orders.
Architecture
The My Profile Web Part contains the following components:
MyProfileWebPart. Loads user controls dynamically. Derived from BaseUserControlWebPart that encapsulates ASCX loading functionality.
MyProfile.ascx User Control. Houses the user interface components and corresponding event handlers. This user control displays all the properties of a shopper’s profile such as first name, last name, and date of birth. It also provide validation when attempting to save the shopper’s profile after an edit is made.
Properties
The following table lists and describes the properties for the My Profile Web Part.
Property |
Maps to |
Type |
Description |
Default |
---|---|---|---|---|
Instructional text |
InstructionText |
String |
Sets the text block displayed below the title. Can be used to provide instructions to end users. |
Fill out the required fields to change your personal information. |
"* are required fields" label text |
RequiredFieldsText |
String |
Sets the text displayed under the instructional text which indicates that fields marked with a '*' are required. |
* Indicates required field. |
"User Id" label text |
UserIdLabelText |
String |
Sets the text displayed beside the "user id" field. |
User ID: |
New e-mail address label text |
String |
Sets the text displayed beside the "email" text box. |
* New e-mail address |
|
"First name" label text |
FirstNameLabelText |
String |
Sets the text displayed beside the "first name" text box. |
* First name |
"Last name" label text |
LastNameLabelText |
String |
Sets the text displayed beside the "last name" text box. |
* Last name |
"Use Live Id" check box text |
UseLiveIDText |
String |
Sets the text displayed beside the "use Live Id" check box. |
Associate With My LiveID Account |
"Shipping method" label text |
ShippingMethodLabelText |
String |
Sets the text displayed beside the "shipping method". |
Shipping Method |
"Last name is required" message |
LastNameRequiredErrorMessage |
String |
Sets the text displayed when the user submits without supplying a value for "last name". |
Please enter your last name |
"First name is required" message |
FirstNameRequiredErrorMessage |
String |
Sets the text that is displayed when the user submits an invalid value for "first name". |
Please enter your first name |
"Save" button text |
SaveButtonText |
String |
Sets the text displayed on the "save" button. |
Save Updates |
"Personal information" section title text |
PersonalInformationLabelText |
String |
Sets the text displayed above the "personal information" section. |
Personal Information |
"Personal preferences" section title text |
PersonalPreferencesText |
String |
Sets the text displayed above the "personal preferences" section. |
Personal Preferences |
"Allow additional communications" check box text |
CheckCommunicationText |
String |
Sets the text displayed beside the "allow additional communications" check box. The check box allows the user to opt-in to whatever the text describes here. |
Please do not send me marketing messages. |
"Email" Label Text |
EmailLabelText |
String |
Sets the text displayed on the label of the e-mail field. |
Email Address |
"Current e-mail address" label |
String |
Sets the text displayed on the label of the current e-mail address field. |
Current e-mail address |
|
Compare e-mail error message |
String |
Sets the text displayed when the user submits with mismatching e-mail addresses in the "e-mail address" and "Confirm e-mail address" fields. |
The e-mail address and Confirm e-mail address must match |
|
Confirm e-mail error message |
String |
Sets the text displayed when the user submits without supplying a value for "Confirm e-mail address". |
Please re-enter your e-mail address for confirmation |
|
Validate e-mail error message |
String |
Text displayed if the e-mail address entered does not meet standard email formats as set by the E-mail Validation Expression. |
Please enter a valid e-mail address |
|
E-mail Validation Expression |
String |
The regular expression that defines valid e-mail addresses. |
\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* |
|
"Confirm new e-mail address" label text |
String |
Text displayed on the label of the "confirm new e-mail address" field. |
* Confirm new e-mail address |
|
Email required error message |
String |
Sets the text displayed when the user submits without supplying a value for "e-mail address". |
Please enter your e-mail address |
|
Cancel Button Text |
String |
Sets the text displayed on the "cancel" button |
Cancel Updates |
|
Profile Preferences label text |
String |
Sets the text in the Profile Preferences section. |
Profile Preferences |
|
Change Email Instruction Text |
String |
Sets the text block displayed to provide instructions to end users. |
You will be required to log in again after updating your e-mail address |
|
Log-in with user name |
EnableUserNameAsLogOn |
Boolean |
If checked, allows the shopper to log in with their user name. |
False |
Cancel Button URL |
String |
Sets the page URL to redirect to if user cancels profile update. |
/MyAccount/Pages/myAccount.aspx |
Customization
You can customize the My Profile Web Part by modifying the MyProfile.ascx user control, including its code-behind.
Important Note: |
---|
If you make modifications to the ASCX file to customize a Web Part, rename the modified ASCX file to avoid the risk of overwriting your Web Part customizations during an upgrade. |
Error Handling
There is no design-time error handing required for this Web Part.
API Dependencies
The dependencies on the API are:
Retrieve properties of the API Profile object
Modify properties of the API Profile object