ASPxClientControlCollection.GetByName(name) Method

Returns a DevExpress client control object identified by its unique hierarchically-qualified identifier (either ClientInstanceName or ClientID property value).


    name: string
): any


Name Type Description
name string

A string value that is the hierarchically-qualified identifier of the required DevExpress control.


Type Description

An object that is the client control object found.


The GetByName method provides you with programmatic access to a DevExpress control's client object specified by the control's hierarchically-qualified identifier (namely the value of its ClientInstanceName or ClientID property), that uniquely identifies the object on the client side.

This method initially searches an object specified by the name parameter within the DevExpress collection of client objects, and then (if it is not found) - within the window's entire collection of client objects. If found, an object instance is returned.

In some cases, using the GetByName method might be an alternative to using a control's ClientInstanceName property. For instance, when working with templates, there might be situations when the client identifier of a web control's top HTML element is composed dynamically within iterative loops on the client. Within each loop, you can use the static ASPxClientControl.GetControlCollection method and the GetByName method to evaluate the HTML element and access its corresponding client object (ASPxClient...) providing the entire required client API.


This example demonstrates how the ASPxClientControl.GetControlCollection and ASPxClientControlCollection.GetByName methods can be used on the client, to access an ASPxTextBox editor's client instance. The editor is contained within an ASPxPanel control, which is placed within the first tab page of an ASPxPageControl.

<form id="form1" runat="server">

    <script type="text/javascript" >
        var editorClientId = "<%=ASPxTextBox1.ClientID%>";

    <dx:ASPxPageControl ID="ASPxPageControl1" runat="server" ActiveTabIndex="0">
                    <dx:ContentControl runat="server">

                        <dx:ASPxPanel ID="ASPxPanel1" runat="server" Width="200px">
                                <dx:PanelContent runat="server">

                                    <dx:ASPxTextBox ID="ASPxTextBox1" runat="server" ClientInstanceName="myTextBox" Text="Some text" Width="170px">


                    <dx:ContentControl ID="ContentControl1" runat="server">

    <dx:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="False" Text="Get text">
        <ClientSideEvents Click="function(s, e) {
            var editor = ASPxClientControl.GetControlCollection().GetByName(editorClientId);
        }" />
See Also