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

ASPxRichEdit.ClientInstanceName Property

Specifies the ASPxRichEdit‘s client programmatic identifier.

Namespace: DevExpress.Web.ASPxRichEdit

Assembly: DevExpress.Web.ASPxRichEdit.v20.2.dll

NuGet Package: DevExpress.Web.Office

Declaration

[DefaultValue("")]
public string ClientInstanceName { get; set; }

Property Value

Type Default Description
String String.Empty

The control’s client identifier.

Remarks

Use the ClientInstanceName property to specify a unique client-side identifier for the ASPxRichEdit control. Use this identifier on the client side to access the ASPxClientRichEdit object programmatically.

Example

<script type="text/javascript">
    function getAllText() {
        return RichEdit.document.activeSubDocument.text;
    }
    function getSelectedText() {
        var firstSelectedInterval = RichEdit.selection.intervals[0];
        var selectedText = RichEdit.document.activeSubDocument.text.substr(firstSelectedInterval.start, firstSelectedInterval.length);
        return selectedText;
    }
</script>
<dx:ASPxButton runat="server" ID="Button1" Text="Get All Text" AutoPostBack="false">
    <ClientSideEvents Click="function(s, e) { alert(getAllText()); }" />
</dx:ASPxButton>
<dx:ASPxButton runat="server" ID="Button2" Text="Get Selected Text" AutoPostBack="false">
    <ClientSideEvents Click="function(s, e) { alert(getSelectedText()); }" />
</dx:ASPxButton>

<dx:ASPxRichEdit ID="RichEdit" runat="server" ClientInstanceName="RichEdit">
</dx:ASPxRichEdit>

The ClientInstanceName property is important when a control is contained within a naming container, for instance, within an ASPxPageControl‘s page or an ASPxPopupControl‘s window.

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 within a naming container.

See Also