May 22, 2015, 4:06 PM
Ext.Net.MVC 3.1: Async/Await direct methods.
Hello,
I try to use async/await in DirectMethods, but I get "App.direct.Method is undefined" error.
code
but I couldn't find RegisterAsyncTask method in controller.
Is there some ways to use async/await with DirectMethods?
I try to use async/await in DirectMethods, but I get "App.direct.Method is undefined" error.
code
[DirectController]
public class MyController : Controller
{
[DirectMethod(Timeout = 300000, ShowMask = true, Target = MaskTarget.Page)]
public async Task<ActionResult> Method(string data)
{
string text = await Task<string>.Factory.StartNew(() => { return data; });
return Json(new { text = text });
}
}
I saw this link http://forums.ext.net/showthread.php...th-async-awaitbut I couldn't find RegisterAsyncTask method in controller.
Is there some ways to use async/await with DirectMethods?
Last edited by Yury; May 25, 2015 at 9:11 AM.