Back to Devexpress

ASPxButton.ClientSideEvents Property

aspnet-devexpress-dot-web-dot-aspxbutton-fcd5a7ce.md

latest2.5 KB
Original Source

ASPxButton.ClientSideEvents Property

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

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public ButtonClientSideEvents ClientSideEvents { get; }
vb
Public ReadOnly Property ClientSideEvents As ButtonClientSideEvents

Property Value

TypeDescription
ButtonClientSideEvents

An object that allows you to handle ASPxButton‘s client-side events.

|

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

csharp
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);
     }
 }

See Also

Client-Side Events

ASPxButton Class

ASPxButton Members

DevExpress.Web Namespace