Latest web development tutorials

ASP.NET LinkButton control

Web Server Controls Web server control

Definition and Usage

LinkButton control is used to create a hyperlink style button.

NOTE: The appearance of the control with HyperLink control the same, but the functionality is the same as the Button control.


Attributes

属性 描述 .NET
CausesValidation 规定当 LinkButton 控件被点击时是否验证页面。 1.0
CommandArgument 有关所执行命令的附加信息。 1.0
CommandName 与 Command 事件相关的命令。 1.0
OnClientClick 当 LinkButton 控件被点击时被执行的函数的名称。 2.0
PostBackUrl 当 LinkButton 控件被点击时从当前页面进行回传的目标页面的 URL。 2.0
runat 规定该控件是服务器控件。必须设置为 "server"。 1.0
Text LinkButton 上的文本。 1.0
ValidationGroup 当其回传服务器时,该 LinkButton 控件引起的验证所针对的控件组。 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 full description, visit the Web Control Standard Attributes .

Control Standard Properties

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

For a full description, go to Control Standard Attributes .


Examples

LinkButton
In this example, we declare in an .aspx file a LinkButton control, and a Label control. When the user clicks on the link, it will execute lbClick subroutine. This subroutine sends the text as the Label control "You clicked the LinkButton control".


Web Server Controls Web server control