Address Detail Web Part

The Address Detail Web Part lets shoppers view their recorded addresses and provides some administrative tasks on those addresses. Both shipping and billing addresses are grouped in the list and the shopper can display only shipping, only billing, or both types of address.

The shopper can also mark an address for shipping or billing purposes. Once marked as such, the shopper can further designate an address as the primary or secondary address for billing or shipping (or both). A single address can be both a shipping and billing address and can be the primary address in both categories. The system allows only one primary shipping and one primary billing address.

From the Address Detail Web Part, shoppers can remove an address. When shoppers remove an address, they are prompted to confirm their action. Shoppers can also choose to edit or add a new address, which redirects them to the Address Detail Web Part.

The field labels are dynamic based on the locale and culture of the page. The Address Detail Web Part lets shoppers view their recorded addresses and provides some administrative tasks on those addresses. Both shipping and billing addresses are grouped in the list and shoppers are able to display only shipping, only billing, or both types of address.

Architecture

You can use the Address Detail Web Part in three possible deployment environments; Windows SharePoint Services, Microsoft Office SharePoint Server, or a standard ASP.NET 2.0 site.

  • AddressListWebPart/SPAddressListWebPart: dynamically loads the AddressList user control

  • AddressType.ascx: a Web user control that you use to manage address type through a collection of check boxes to represent address type. This user control has a property named EnableAddressTypeUpdate that, when set to True, will update the address type in the back-end repository, and otherwise will manage the check boxes' checked status. In the Address List Web Part, this property is set to True.

  • ReadOnlyAddressDetail.ascx: this user control uses MVP design pattern, used to display address properties in read-only mode.

  • AddressList.ascx: a Web user control that displays a list of the shoppers' addresses. The shopper is able to filter the list by categories presented in two checkboxes. The shopper is also able to use links and actions presented in the list to redirect the Address Detail Web part to edit or create a new address. Two checkboxes are displayed beneath each address that lets the shopper mark an address as a shipping address or a billing address.

Properties

The following table lists the mapping of the properties for the Address Detail Web Part.

Property

Maps to

Use "deletion confirmation" pop-up

ConfirmDeletion

Display "back" button

AllowBackUrlButton

"Address Detail" page URL

AddressDetailUrl

"Action" URL parameter

ActionQueryParameter

"Address ID" URL parameter

AddressIdQueryParameter

"Address list" section title text

AddressListHeaderLiteral

"Is billing address" check box text

BillingAddressCheckBoxText

"Add new address" button text

ButtonAddNewAddressText

"Back" button text

ButtonBackText

"Edit" button text

ButtonEditText

"Remove" button text

ButtonRemoveText

"City" label text

CityLabelText

"Country" label text

CountryLabelText

CSS class

CssClass

"Default billing address" check box text

DefaultBillingAddressCheckBoxText

"Default shipping address" check box text

DefaultShippingAddressCheckBoxText

"Delete confirmation" pop-up text

DeleteConfirmationMessage

Instructional text

InstructionTextLiteral

"Line 1" label text

Line1LabelText

"Line 2" label text

Line2LabelText

"Billing addresses list" text

ListBillingAddressesText

"Shipping addresses" list text

ListShippingAddressesText

"Phone number" label text

PhoneNumberLabelText

"Postal code" label text

PostalLabelText

"Province" label text

ProvinceLabelText

Layout : # of columns

RepeatColumns

Layout : Orientation

RepeatDirection

"Is shipping address" check box text

ShippingAddressCheckBoxText

"State" label text

StateLabelText

"View" label text

ViewAddressesLabelText

"Zip code" label text

ZipLabelText

Customization

You can customize the Address Detail Web Part by modifying the .ascx file.

Error Handling

There is no design-time error handing required for this Web Part.

API Dependencies

The Address Detail Web Part is dependent on the UserProfile API. Addresses are related to a user profile and, therefore, are retrieved by using QueryRelatedItem<Address>. You can use the strongly typed address properties Line1, AddressName, City, CountryRegionCode, StateProviceCode, ZipPostalCode. You can also use the weakly typed properties Telephone and Line2.

See Also

Other Resources

Developing with SharePoint Commerce Services

Profile Administration System Web Parts

Working With the Address Detail Web Part