Skip to main content
A newer version of this page is available. .
Tab

ASPxButton.ClientSideEvents Property

Gets an object that lists the client-side events specific to the ASPxButton.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

NuGet Package: DevExpress.Web

Declaration

public ButtonClientSideEvents ClientSideEvents { get; }

Property Value

Type Description
ButtonClientSideEvents

A ButtonClientSideEvents object which allows assigning handlers to the client-side events available to the ASPxButton.

Remarks

The returned object contains properties whose names correspond to the events available to the ASPxButton control on the client side. These properties give you the ability to assign handling JavaScript functions to the button’s required client-side events.

Example

The complete sample project is available in the DevExpress Code Central database at E73.

 using System;
 using System.Data;
 using System.Configuration;
 using System.Collections;
 using System.Web;
 using System.Web.Security;
 using System.Web.UI;
 using System.Web.UI.WebControls;
 using System.Web.UI.WebControls.WebParts;
 using System.Web.UI.HtmlControls;
 using DevExpress.Web.ASPxNavBar;

 public partial class WebUserControl : System.Web.UI.UserControl, ITemplate
 {

     protected void Page_Load(object sender, EventArgs e){
      NavBarItemTemplateContainer container = this.NamingContainer 
           as NavBarItemTemplateContainer;
      string groupIndex = container.Item.Group.Index.ToString();
      ASPxButton1.ClientSideEvents.Click = "function(s, e)
          {OnButtonClick(s, e, true, " + groupIndex + ")}";
      ASPxButton2.ClientSideEvents.Click = "function(s, e)
          {OnButtonClick(s, e, false, " + groupIndex + ")}";
     }

     void ITemplate.InstantiateIn(Control container) {
         container.Controls.Add(this);
     }
 }

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ClientSideEvents property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also