RichEditExtension.Open(String, String, DocumentFormat, Func<Byte[]>) Method
Opens a document in the specified format from an array of bytes.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.1.dll
NuGet Package: DevExpress.Web.Mvc5
Declaration
public static ActionResult Open(
string extensionName,
string uniqueDocumentID,
DocumentFormat format,
Func<byte[]> contentAccessorByBytes
)
Parameters
Name | Type | Description |
---|---|---|
extensionName | String | The RichEdit name. |
uniqueDocumentID | String | The document identifier. |
format | DocumentFormat | The document format. |
contentAccessorByBytes | Func<Byte[]> | A method delegate to obtain a byte array from which to open the document. |
Returns
Type | Description |
---|---|
ActionResult | An object that represents the result of the operation. |
Remarks
Call this Open method to load a document from an array of bytes. Specify the uniqueDocumentID parameter to identify the document. If the specified value is not unique within all open documents, the method activates the previously loaded document with the same uniqueDocumentID and ignores the array of bytes.
Note that the Open method uses the control’s parameters stored as an additional parameter of the control’s work session to restore all the controls settings and return a relevant partial view in a controller action. It is recommended to avoid using the DocumentManager.CloseAllDocuments method that clears all the session parameters, including control settings and close only specific documents using the documents names.
Alternatively, you can open documents by passing a document name from a controller to a partial view using the View Data collection and invoking the Open method directly in the partial view.