asp.net.ph

ButtonFieldBase.ButtonType Property

System.Web.UI.WebControls Namespace   ButtonFieldBase Class


.NET Framework version 2.0

Sets or retrieves the type of button to render in the column.

Syntax


Inline <asp:buttonfieldbase buttontype = enumValue ... >
Script ButtonFieldBase.ButtonType = enumValue

Property Value


enumValue One of the ButtonType values.

The property is read/write with a default value of Link.

Exceptions


Exception Type Condition
ArgumentException The given column type is not one of the ButtonType values.

Remarks

Use the ButtonType property to specify or determine whether the buttons in a field that derives from the ButtonFieldBase class ( are displayed as link, push, or image buttons.

Clicking a button in a button field raises the command event of the parent data-bound control, for which you can respond to and perform some action by providing an event handler for the command event.

NOTE: The GridView control raises the RowCommand event, while the DetailsView control raises the ItemCommand event.

Example

The following example demonstrates how to set the ButtonType property of a ButtonField at design time, and how to dynamically set the style properties of the buttons in the column at run time.

ButtonField ButtonType Example
Run Sample | View Source
See Also

ButtonFieldBase Members   Adding Button Fields to a GridView Control Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph