Name

LinkButton

Synopsis

This class represents a control that appears like a HyperLink control, but fires a Click and Command event like a Button control would. A good use of this control is to provide a hyperlink that navigates to another web page but allows you to perform some programmatic cleanup (for example, clearing session variables) before you redirect the user.

Like all button controls, the LinkButton class provides a CausesValidation property you can set to prevent page validation from occurring when the control is clicked. It also provides the standard CommandName and CommandArgument properties that allow you to specify additional information that will be sent to a Command event.

Public Class LinkButton : 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  
   Overridable Public Property Text As String  
' Protected Instance Methods
   Overrides Protected Sub AddAttributesToRender(
        ByVal writer As System.Web.UI.HtmlTextWriter) 
   Overrides Protected Sub AddParsedSubObject(
        ByVal obj As Object) 
   Overrides Protected Sub LoadViewState(
        ByVal savedState As Object) 
   Overridable Protected Sub OnClick(ByVal e As EventArgs) 
   Overridable Protected Sub OnCommand(
        ByVal e As CommandEventArgs) 
   Overrides Protected Sub OnPreRender(ByVal e As EventArgs) 
   Overrides Protected Sub RenderContents ...

Get ASP.NET in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.