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

ASPxLabel

The ASPxLabel control allows you to display text on a web page.

ASPxLabel - Label

Features

  • Associate a Label with a Control

    You can associate a control with the Label control (ASPxLabel.AssociatedControlID). On a web page, a browser renders the label as an HTML label element. The label’s “for” attribute is set to the associated control’s ID property.

    <dx:ASPxLabel ID="ASPxLabel1" runat="server" AssociatedControlID="ASPxComboBox1" Text="ASPxLabel">
    </dx:ASPxLabel>
    <dx:ASPxComboBox ID="ASPxComboBox1" runat="server">
    </dx:ASPxComboBox>
    
  • Appearance Customization

    You can customize control appearance as follows: apply a DevExpress Theme, style settings, or assign CSS classes.

    <dx:ASPxLabel runat="server" Text="Label Text" BackColor="Red" ID="Label" ForeColor="White" />
    <dx:ASPxCheckBox runat="server" Text="Successfull" OnCheckedChanged="OnCheckedChanged" AutoPostBack="true" />
    
    protected void OnCheckedChanged(object s, EventArgs e) {
        Label.BackColor = (s as ASPxCheckBox).Checked ? System.Drawing.Color.Green : System.Drawing.Color.Red; 
    }   
    
  • Client-Side API

    The label control’s client-side API is implemented with JavaScript and exposed by the ASPxClientLabel object.

    Availability

    Available by default.

    Class name

    ASPxClientLabel

    Access name

    ClientInstanceName

    Events

    ASPxLabel.ClientSideEvents

    ```aspx <dx:ASPxTextBox ID=”ASPxTextBox1” runat=”server” Width=”170px” ClientInstanceName=”textBox”></dx:ASPxTextBox> <dx:ASPxButton ID=”ASPxButton1” runat=”server” Text=”Set Label Text” AutoPostBack=”False” > </dx:ASPxButton> <dx:ASPxLabel ID=”ASPxLabel1” runat=”server” Text=”” ClientInstanceName=”label”> </dx:ASPxLabel>

    ***