Back to Devexpress

How to: Obtain Server Data From the Client

aspnet-3826-components-grid-view-examples-how-to-obtain-server-data-from-the-client.md

latest1.0 KB
Original Source

How to: Obtain Server Data From the Client

  • Oct 04, 2021

This example demonstrates how to obtain server data from the client. A temporary client property— cpPageIndex —is declared within the ASPxGridView.CustomJSProperties event handler. This property holds the index of the currently active page, and can be accessed on the client side.

csharp
protected void ASPxGridView1_CustomJSProperties(object sender,
   DevExpress.Web.ASPxGridViewClientJSPropertiesEventArgs e) {
    e.Properties["cpPageIndex"] = ASPxGridView1.PageIndex;
}
vb
Protected Sub ASPxGridView1_CustomJSProperties(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxGridViewClientJSPropertiesEventArgs)
    e.Properties("cpPageIndex") = ASPxGridView1.PageIndex
End Sub
aspx
<input id="Button1" type="button" value="Active Page" onclick="alert(grid.cpPageIndex)" />