ButtonFieldBase Class
Assembly: System.Web (in system.web.dll)
The ButtonFieldBase class is the abstract base class for button fields and contains the methods and properties that are common to all button fields. Because this class is abstract, you cannot create an instance of it directly. Instead, you must create an instance of a non-abstract class that inherits from the ButtonFieldBase class, such as the ButtonField or CommandField class.
An object that is derived from the ButtonFieldBase is used by data-bound controls (such as the GridView and DetailsView controls) to display one or more buttons for each record that is displayed. A button field is displayed differently depending on the data-bound control in which it is used. For example, the GridView control displays a button field as a column, whereas the DetailsView control displays it as a row.
Clicking a button in a button field raises the command event of the parent data-bound control. You can provide a custom routine to perform when a button is clicked by providing an event handler for the command event.
Note: |
|---|
| The GridView control raises the RowCommand event, whereas the DetailsView control raises the ItemCommand event. |
To specify the type of button to display, use the ButtonType property. To show or hide the header section of a ButtonFieldBase object, set the ShowHeader property.
Note: |
|---|
| Some data-bound controls (such as the GridView control) can show or hide only the entire header section of the control. These data-bound controls do not support the ShowHeader property for an individual button field. To show or hide the entire header section of a data-bound control (if available), use the ShowHeader property for the control. |
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
System.Web.UI.WebControls.DataControlField
System.Web.UI.WebControls.ButtonFieldBase
System.Web.UI.WebControls.ButtonField
System.Web.UI.WebControls.CommandField
Note: