LinkButton

LinkButtondisposable

System.Web.UI.WebControls (system.web.dll)class

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 : WebControl, System.Web.UI.IPostBackEventHandler { // Public Constructors    public LinkButton( ); // Public Instance Properties    public bool CausesValidation{set; get; }    public string CommandArgument{set; get; }    public string CommandName{set; get; }    public virtual string Text{set; get; } // Protected Instance Methods    protected override void AddAttributesToRender(                // overrides WebControl  System.Web.UI.HtmlTextWriter writer);    protected override void AddParsedSubObject(object obj);      // overrides System.Web.UI.Control    protected override void LoadViewState(object savedState);    // overrides WebControl    protected virtual void OnClick(EventArgs e);    protected virtual void OnCommand(CommandEventArgs e);    protected override void OnPreRender(EventArgs e);            // overrides System.Web.UI.Control    protected override void RenderContents(System.Web.UI.HtmlTextWriter writer); // overrides WebControl // Events    public event EventHandler Click;    public event CommandEventHandler Command; }

Hierarchy

System.Object System.Web.UI.Control(System.ComponentModel.IComponent, System.IDisposable, System.Web.UI.IParserAccessor, System.Web.UI.IDataBindingsAccessor) WebControl(System.Web.UI.IAttributeAccessor) LinkButton(System.Web.UI.IPostBackEventHandler)



ASP. NET in a Nutshell
ASP.NET in a Nutshell, Second Edition
ISBN: 0596005202
EAN: 2147483647
Year: 2003
Pages: 873

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net