Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ButtonFieldBase Class

Note: This class is new in the .NET Framework version 2.0.

Serves as the abstract base class for button fields, such as the ButtonField or CommandField class. The ButtonFieldBase class provides the methods and properties that are common to all button fields.

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

public abstract class ButtonFieldBase : DataControlField
public abstract class ButtonFieldBase extends DataControlField
public abstract class ButtonFieldBase extends DataControlField

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.

NoteNote

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.

NoteNote

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.

Notes to Inheritors When you inherit from the ButtonFieldBase class, you must override the following member: CopyProperties.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.