Skip to main content

RichEditSettings.AutoSaveTimeout Property

Gets or sets the timeout for autosaving.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public TimeSpan AutoSaveTimeout { get; set; }

Property Value

Type Description
TimeSpan

An integer value specifying the timeout, in milliseconds.

Remarks

When the AutoSaveMode property is set to On, Rich Text Editor saves the active document automatically on each timeout specified by the AutoSaveTimeout property. Note, to improve editor performance, the DocumentManager processes multiple documents in parts with a 20-second interval. This behavior can cause a difference between the specified and the actual autosave timeout. For instance, when the specified timeout is short and the document manager processes a lot of documents, the actual timeout duration can increase.

If a document is opened by multiple Rich Text Editors with the autosave feature enabled, the timeout is set to the smallest value among all these editors.

@Html.DevExpress().RichEdit(settings => {
    settings.Name = "RichEdit";
    settings.CallbackRouteValues = new { Controller = "DocumentManagement", Action = "LoadAndSavePartial" };
    settings.WorkDirectory = "~/App_Data/Documents";
    settings.AutoSaveMode = DevExpress.Web.Office.Internal.AutoSaveMode.On;
    TimeSpan timeout = TimeSpan.FromMinutes(1);
    settings.AutoSaveTimeout = timeout;
}).GetHtml()

The autosave feature invokes the AutoSaving event that allows you to implement custom autosave logic. If you do not handle the event (the e.Handled property is set to false), the editor processes the document in the following ways:

  • If a document is opened from the server’s local file system, the editor overwrites the original document file.
  • If a document is new, or a document was opened from a custom document storage, the editor throws an exception. Handle the AutoSaving event to implement custom saving logic.
See Also