Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ASP.NET LinkButton Control

ASP.NET LinkButton Control


Web Server Controls Web Server Controls


Definition and Usage

The LinkButton control is used to create a button styled as a hyperlink.

**Note:** This control looks the same as the HyperLink control, but its function is the same as the Button control.


property

property Description .NET
CausesValidation Specifies whether the page is validated when the LinkButton control is clicked. 1.0
CommandArgument Additional information about the command being executed. 1.0
CommandName The command associated with the Command event. 1.0
OnClientClick The name of the function executed when the LinkButton control is clicked. 2.0
PostBackUrl The target page URL to which the LinkButton control posts back from the current page when clicked. 2.0
runat Specifies that the control is a server control. Must be set to "server". 1.0
Text The text on the LinkButton. 1.0
ValidationGroup The control group for which validation is triggered by this LinkButton control when it posts back to the server. 2.0

Web Control Standard Properties

AccessKey, Attributes, BackColor, BorderColor, BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming, ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width

For a complete description, please visit Web Control Standard Properties。

Web Control Standard Properties

AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible

For a complete description, please visit Web Control Standard Properties。


Example

LinkButton
In this example, we declare a LinkButton control and a Label control in the .aspx file. When the user clicks this link, the lbClick subroutine is executed. This subroutine sends the text "You clicked the LinkButton control" to the Label control.


Web Server Controls Web Server Controls