ButtonField::Text Property
Gets or sets the static caption that is displayed for each button in the ButtonField object.
Assembly: System.Web (in System.Web.dll)
Property Value
Type: System::StringThe 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.
Note: |
|---|
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.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: