RichEditExtension.GetCallbackResult(String, Action<RichEditCustomDocumentProcessor>) Method
In This Article
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.2.dll
NuGet Package: DevExpress.Web.Mvc5
#Declaration
public static ActionResult GetCallbackResult(
string extensionName,
Action<RichEditCustomDocumentProcessor> method
)
#Parameters
Name | Type | Description |
---|---|---|
extension |
String | A string value specifying the name of the processed Rich |
method | Action<Rich |
A delegate method of the Rich |
#Returns
Type | Description |
---|---|
Action |
A Action |
#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