Back to Devexpress

ASPxRichEdit.DocumentId Property

aspnet-devexpress-dot-web-dot-aspxrichedit-dot-aspxrichedit-06b80425.md

latest3.1 KB
Original Source

ASPxRichEdit.DocumentId Property

Specifies the unique identifier of the active document.

Namespace : DevExpress.Web.ASPxRichEdit

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

NuGet Package : DevExpress.Web.Office

Declaration

csharp
public string DocumentId { get; set; }
vb
Public Property DocumentId As String

Property Value

TypeDescription
String

The document identifier.

|

Remarks

A document in the web server’s memory is identified by a unique string – document ID. All operations that you perform in ASPxRichEdit affect the active (last opened) document whose document ID value is contained in the DocumentId property.

View Example: How to save/load documents to/from a database

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DocumentId property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-web-forms-richedit-work-with-database/CS/ASPxRichEdit_Binding/Default.aspx.cs#L60

csharp
protected void SqlDataSource1_Updating(object sender, SqlDataSourceCommandEventArgs e) {
    e.Cancel = RichEdit.DocumentId == string.Empty; //Save only opened documents
    e.Command.Parameters["@Id"].Value = RichEdit.DocumentId;

asp-net-web-forms-richedit-work-with-database/VB/ASPxRichEdit_Binding/Default.aspx.vb#L62

vb
Protected Sub SqlDataSource1_Updating(ByVal sender As Object, ByVal e As SqlDataSourceCommandEventArgs)
    e.Cancel = Equals(RichEdit.DocumentId, String.Empty) 'Save only opened documents
    e.Command.Parameters("@Id").Value = RichEdit.DocumentId

See Also

RichEdit Document Management

ASPxRichEdit Class

ASPxRichEdit Members

DevExpress.Web.ASPxRichEdit Namespace