System.Web.UI.WebControls.ImageField.DataAlternateTextFormatString Property

Gets or sets the string that specifies the format in which the alternate text for each image in an System.Web.UI.WebControls.ImageField object is rendered.

Syntax

[System.ComponentModel.DefaultValue("")]
public virtual string DataAlternateTextFormatString { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the ImageField.DataAlternateTextFormatString property to specify a custom format for the alternate text values of the images displayed in an System.Web.UI.WebControls.ImageField object.

Note:

The format string is applied only when the ImageField.DataAlternateTextField property is set. It is not applied when the ImageField.AlternateText property is set.

This is useful when you need to modify the original value contained in the field. If the ImageField.DataAlternateTextFormatString property is not set, the alternate text values do not get any special formatting.

The format string can be any literal string and usually contains a placeholder for the field's value. For example, in the format string "Item Value: {0}", the "{0}" placeholder is replaced with the value of the fields specified by the ImageField.DataAlternateTextField property. The rest of the format string is displayed as literal text.

Note:

If the format string does not include a placeholder, the field's value from the data source is not included in the final display text.

The placeholder consists of two parts separated by a colon (":") and wrapped in braces ("{}"), in the form {A:Bxx}. The value before the colon (A in the general example) specifies the field value's index in a zero-based list of parameters.

Note:

This parameter is part of the formatting syntax. Because there is only one field value in each cell, this value can only be set to 0.

The colon and the values after the colon are optional. The character after the colon (B in the general example) specifies the format in which to display the value. The following table lists the common formats.

C

Displays numeric values in currency format.

D

Displays numeric values in decimal format.

E

Displays numeric values in scientific (exponential) format.

F

Displays numeric values in fixed format.

G

Displays numeric values in general format.

N

Displays numeric values in number format.

X

Displays numeric values in hexadecimal format.

Note:

The format characters are not case sensitive, except for X, which displays the hexadecimal characters in the case specified.

The value after the format character (xx in the general example) specifies the number of significant digits or decimal places to display. For example, the format string "{0:F2}" displays a fixed-point number with 2 decimal places.

For more information on formatting, see Formatting Overview.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0