PDA

View Full Version : Ext.Net.MVC 3.1: Async/Await direct methods.



Yury
May 22, 2015, 4:06 PM
Hello,

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?27132-CLOSED-DirectMethod-with-async-await
but I couldn't find RegisterAsyncTask method in controller.

Is there some ways to use async/await with DirectMethods?

Yury
Jun 05, 2015, 12:20 PM
Hello,

Somebody knows how to use async/await action methods with Ext.Net.MVC?

I've tried to use async/await actions with ComponentLoader, but it doesn't work. As I can see it is problem for ext.net in general.

Daniil
Dec 02, 2015, 3:26 PM
Hi Yury,

Yes, it is not supported.

There is something that could make it working in some scenarios.
http://forums.ext.net/showthread.php?27132&p=120588&viewfull=1#post120588

Though, I could not get it working in MVC.

Logged in GitHub as a feature request.
https://github.com/extnet/Ext.NET/issues/946

Though, I cannot provide any time frame and would recommend not to expect it is going to appear soon.