Skip to main content

ASPxClientButton.SetText(value) Method

Sets the text to be displayed within the button.

Declaration

SetText(
    value: string
): void

Parameters

Name Type Description
value string

A string value specifying the text to be displayed within the button.

Remarks

Note

  • If the ASPxButton.Text property is empty and a button image is specified, a text element markup is not rendered. In this case, it is impossible to set a text on the client side using the SetText method.
  • The SetText method does not HTML encode the specified text.

Example

Refer to the following demo for a full example: Button - Features.

<script>
     function onCheckedChanged(s, e) {
          if (s.GetChecked()) {
               button.SetEnabled(false);
               s.SetText("Enable Button");
          } else {
               button.SetEnabled(true);
               s.SetText("Disable Button");
          }
     }
</script>
<dx:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="False" GroupName="G" Text="Disable Button">
     <ClientSideEvents CheckedChanged="onCheckedChanged" />
</dx:ASPxButton>
<dx:ASPxButton ID="ASPxButton2" runat="server" AutoPostBack="False" ClientInstanceName="button" Text="Button">
</dx:ASPxButton>
See Also