ASPxPopupControlBase.ClientInstanceName Property
Specifies the ASPxPopupControl‘s or ASPxDockPanel‘s client programmatic identifier.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
#Property Value
Type | Default | Description |
---|---|---|
String | String. |
A control’s client identifier. |
#Remarks
Use the ClientInstanceName property to specify a unique client-side identifier for the ASPxPopupControl/ASPxDockPanel control. Use this identifier on the client side to programmatically access the ASPxClientPopupControl/ASPxClientDockPanel object.
The ClientInstanceName property is important when a control is contained in a naming container, for instance, in an ASPxPageControl‘s page.
If the ClientInstanceName property is not specified for a control, the control’s client identifier is generated automatically, and equals the value of the control’s ID property. Note that in this case, client-side programmatic access to the control is not allowed when the control is contained in a naming container.
#Example
<script>
function click(s, e) {
ClientPopupControl.PerformCallback();
}
</script>
<dx:ASPxButton ID="ShowButton" runat="server" Text="Show Popup Window" AutoPostBack="False"/>
<dx:ASPxPopupControl ID="PopupControl" runat="server" ClientInstanceName="ClientPopupControl" LoadContentViaCallback="OnFirstShow"
PopupElementID="ShowButton" ShowFooter="True" Width="310px" Height="160px" HeaderText="Updatable content" >
<ContentCollection>
<dx:PopupControlContentControl ID="PopupControlContentControl" runat="server">
The content of this popup control was updated at<br /> <b> <%= DateTime.Now.ToLongTimeString() %></b>
</dx:PopupControlContentControl>
</ContentCollection>
<FooterTemplate>
<dx:ASPxButton ID="UpdateButton" runat="server" Text="Update Content" AutoPostBack="False">
<ClientSideEvents Click="click" />
</dx:ASPxButton>
</FooterTemplate>
</dx:ASPxPopupControl>
#Special Characters in Client Instance Name
If the ClientInstanceName
property contains special characters, for instance, the dot (.
), you cannot access a client object by this name. Call the GetByName(name) method to retrieve the client-side object instead.
<dx:ASPxTextBox ... ClientInstanceName="SomeType.SomeProp" />
var txt = ASPxClientControl.GetControlCollection().GetByName("SomeType.SomeProp");
txt.SetText("Some Text");