RichEditExtension.GetCallbackResult(String, Action<RichEditCustomDocumentProcessor>) Method
Returns the specified result back to the client side after processing a callback within an Action specified by the RichEditSettings.CallbackRouteValues property.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.1.dll
NuGet Package: DevExpress.Web.Mvc5
Declaration
public static ActionResult GetCallbackResult(
string extensionName,
Action<RichEditCustomDocumentProcessor> method
)
Parameters
Name | Type | Description |
---|---|---|
extensionName | String | A string value specifying the name of the processed RichEdit extension. |
method | Action<RichEditCustomDocumentProcessor> | A delegate method of the RichEditCustomDocumentProcessor type. |
Returns
Type | Description |
---|---|
ActionResult | A ActionResult object that is the result of an action method. |
Remarks
Use this method in an Action specified by the RichEditSettings.CallbackRouteValues property to return the result of callback processing back to the client.
@Html.DevExpress().RichEdit(settings => {
settings.Name = "RichEditNameHere";
settings.CallbackRouteValues = new { Controller = ..., Action = "ActionMethodThatHandlesRichEditCallbacks" };
...
}).Open(...).BindToXML(Server.MapPath("~/App_Data/Documents/MyData.xml")).GetHtml()
public ActionResult ActionMethodThatHandlesRichEditCallbacks() {
return RichEditExtension.GetCallbackResult("RichEditNameHere", p => {
p.Saving(e => {
byte[] docBytes = RichEditExtension.SaveCopy("RichEditNameHere", DocumentFormat.Rtf);
//saving "docBytes" to db
e.Handled = true;
});
p.BindToXML(Server.MapPath("~/App_Data/Documents/MyData.xml"));
});
}
See Also