Back to Devexpress

How to: Obtain Server Data from the Client

aspnet-5456-components-gauges-examples-how-to-obtain-server-data-from-the-client.md

latest1.0 KB
Original Source

How to: Obtain Server Data from the Client

  • Jul 26, 2021

This example demonstrates how to obtain server data from the client. A temporary client property - cpDefaultValue - is declared within the ASPxGaugeControl.CustomJSProperties event handler. This property holds the ASPxGaugeControl’s default value. The ASPxGaugeControl.Value property specifies this value.

csharp
protected void ASPxGaugeControl1_CustomJSProperties(object sender,
           DevExpress.Web.CustomJSPropertiesEventArgs e) {
    e.Properties.Add("cpDefaultValue", ASPxGaugeControl1.Value);
}
aspx
<dxe:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="False" Text="Show Default Value"
    UseSubmitBehavior="False">
    <ClientSideEvents Click="function(s, e) {
        alert('Default Value =' + gc.cpDefaultValue);
    }" />
</dxe:ASPxButton>