asp.net mvc - MVC - async Task<PartialViewResult> -
how call child action (render partial) _layout? mvc not support async partial view?
public async task<partialviewresult> _notification() { var data = new list<usernotification>(); string apinotificationurl = apiprovider.apigenerator("usernotification", new list<string> { "uid" }, true, _usersession.uid); try { //data = await task.run(() => apiprovider.authorize_get<list<usernotification>>(_usersession.token, apinotificationurl)); data = await apiprovider.authorize_get<list<usernotification>>(_usersession.token, apinotificationurl); if (data == null) new list<usernotification>(); } catch (exception ex) { throw; } return partialview(data); }
view
@html.action("_notification", "home")
Comments
Post a Comment