CyberStore Documentation
CharacteristicValueDisplayControl Class
Members  Example 


Dovetail.Ecommerce.Controls Namespace : CharacteristicValueDisplayControl Class
A Characteristic Value display control. Introduced in v2.11.
Remarks

The CharacteristicValueDisplayControl allows you to retrieve a URL-type Characteristic from any Characteristic Family. You can then display the URL as a button or text link that opens the URL either in a window or as an inline image. 

Note:

To utilize the control, you must have a value for the specified Characteristic. When there is no value for the object's Characteristic, the control is invisible.


The control can work with a Characteristic of any Family object-type including Account, Item, Category, Customer, Customer Class, and View List. Upon inspecting the user's current session and page details, the control attempts to retrieve it automatically based on the object-type specified in the Characteristic Family definition.

In addition, you can use the Text and ImageUrl rendering options in the CharacteristicValueDisplayControl to display List- and MultiSelectList-type Characteristics as images.

Property Usage

By changing the values of the control's properties in the SitePages.config file for your Site, you can enable or disable certain behaviors, set certain defaults, alter aspects of the display or otherwise cusomtize your site's implementaion of the control.

The following describes properties pertaining to key functional areas of the control that can be configured to suit your needs.

Each occurrence of the control links to a single Characteristic. To choose the specific Characteristic that will be used, provide its unique Characteristic Family path (e.g., "Family Name/Characteristic Name"). You can do this using the CharacteristicPath property.

In order to set a specific object ID, specify one of the following properties: Account_IDCategory_IDViewList_IDCustomer_IDCustomerClass_ID, or Item_ID. By doing so, the ID specified overrides the default ID determined by the control's automatic processing.

Characteristics of the URL-type can be displayed in one of three display modes using the UrlDisplayMode property's available options:

The size of the displayed image or button can be set using the Width and Height properties.

Properties Inherited from the Base CyberStoreBaseControl

Properties specific to the CyberStoreBaseControl can be listed in the following categories:

Override Properties

When the IgnoreControl property is set to true, all processing of a control is skipped, and the control's Visible property is set to false ensuring that it is not rendered in the resulting CyberStore page.

Contextual Properties

Contextual properties define specific details about the current instance of the control based on context. Context can be set by any number of factors including the log in state of the Shopper, the Site being visited, or the properties that have been established for a control.

The AttributesBag property is used internal to control processing and is the collection of attributes, or properties, and their values based on how the control is configured. The attributes in this property are set by processing the SitePages.config file as well as any specific declared property values in any registered sub controls. It allows for the passing down of all properties to a control and any registered sub controls.

The ComConfigUserData and Site_ID properties are read-only values made available to all CyberStore controls to aid in processing and establishing context about the Site and Shopper.

Example
See an example of how to configure this control in SitePages.config for an inline image.
<Control src="CharacteristicValueDisplayControl.ascx" Name="CharacteristicValueDisplay"
     CharacteristicPath="Family/Characteristic Name"
     UrlDisplayMode="Image"
     Width="100"
     Height="100"
     CharacteristicDisplayCSSClass="SomeClassName"
 />
See an example of how to configure this control in SitePages.config for a link.
<Control src="CharacteristicValueDisplayControl.ascx" Name="CharacteristicValueDisplay"
     CharacteristicPath="Family/Characteristic Name"
     UrlDisplayMode="Link"
     LinkWindowName="WindowName"
     CharacteristicDisplayCSSClass="SomeClassName"
 />
See an example of how to configure this control in SitePages.config for a button.
<Control src="CharacteristicValueDisplayControl.ascx" Name="CharacteristicValueDisplay"
    CharacteristicPath="Family/Characteristic Name"
    UrlDisplayMode="Button"
    ButtonText="[Label]"
    LinkWindowName="WindowName"
    CharacteristicDisplayCSSClass="SomeClassName"
 />
CSS Classes

There are no default CSS classes used by the CharacteristicValueDisplayControl. However, you can create a custom class and assign it to the control by specifying this in the CharacteristicDisplayCSSClass property.

Control Markup

The following is the markup for this control.

Developer's Note:

To create a custom version of the control, copy all of the code below into a file of the same name and place it into your Site's control folder (e.g., ../YourSiteFolder/Control). The CyberStore page engine will then override the default markup with your customized version.

 

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CharacteristicValueDisplayControl.ascx.cs" Inherits="Dovetail.Ecommerce.Controls.CharacteristicValueDisplayControl" %>
<dx:ASPxButton ID="btnCharacteristicUrl" runat="server" AutoPostback="false" Visible="false" />
<dx:ASPxImage ID="imgCharacteristicUrl" runat="server" Visible="false" />
<dx:ASPxLabel ID="lblCharacteristicText" runat="server" Visible="false" />
Inheritance Hierarchy

System.Object
   System.Web.UI.Control
      System.Web.UI.TemplateControl
         System.Web.UI.UserControl
            Dovetail.Ecommerce.ControlBases.CyberStoreBaseControl
               Dovetail.Ecommerce.Controls.CharacteristicValueDisplayControl

See Also

Reference

CharacteristicValueDisplayControl Members
Dovetail.Ecommerce.Controls Namespace