Name
Button
Synopsis
This class represents a simple command button (also known as a push button). Button controls always generate a
postback when clicked. As with all button-like server controls, you can set the CausesValidation property to
determine whether page validation will be performed when the button is clicked, before
the button event handling code is executed. Depending on the client browser’s support for DHTML,
an invalid page may prevent the postback from occurring and the button event handling
code from executing if CausesValidation
is True.
When clicked, a Button raises a Click event followed by a Command event. The Command event passes extra
information about the button in a CommandEventArgs object. This
information includes the CommandName and CommandArgument properties of the Button. A typical CommandName identifies the
requested action (like “Sort”).
Public Class Button : Inherits WebControl : Implements_ System.Web.UI.IPostBackEventHandler ' Public Constructors Public Sub New() ' Public Instance Properties Public Property CausesValidation As Boolean Public Property CommandArgument As String Public Property CommandName As String Public Property Text As String ' Protected Instance Methods Overrides Protected Sub AddAttributesToRender( ByVal writer As System.Web.UI.HtmlTextWriter) Overridable Protected Sub OnClick(ByVal e As EventArgs) Overridable Protected Sub OnCommand( ByVal e As CommandEventArgs) Overrides Protected Sub RenderContents( ByVal writer As System.Web.UI.HtmlTextWriter) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access