ButtonField::Text Property

 

Gets or sets the static caption that is displayed for each button in the ButtonField object.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
property String^ Text {
	virtual String^ get();
	virtual void set(String^ value);
}

Property Value

Type: System::String^

The caption displayed for each button in the ButtonField. The default is an empty string ("").

When the ButtonType property of a ButtonField object is set to the Button or Link value, use the Text property to display static text for the caption of the buttons in the ButtonField. Each button shares the same caption.

Instead of using the Text property to display static text in a ButtonField object, you can use the DataTextField property to bind the ButtonField to a field in a data source. The values of the field are then displayed as the caption of the buttons.

System_CAPS_noteNote

If the DataTextField and Text properties are both set, the DataTextField property takes precedence.

The value of this property is stored in view state.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.

The following code example demonstrates how to use the Text property to specify the caption to display for each button in a ButtonField object.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: