jquery - How to multithread loading partial views? -
i've got dashboard view loads several independent partial views. each partial view takes around quarter of second load (and yes, optimized), i'd find way multithread loading of these partial views make loading faster.
right now, in order render screen quickly, start loading bare-bones view, <div id="mywidget">
section each partial view/widget, in fill in "loading data..." then, in javascript on each partial view, make jquery call load related data. when comes back, replace original mywidget
span partial view.
i widgets work in parallel. how do it?
you try making single ajax call, prepare data widgets. in action method make async calls prepare data in parallel. refer http://www.asp.net/mvc/tutorials/mvc-4/using-asynchronous-methods-in-aspnet-mvc-4#sampleapp
then pass data view model, use different partial views render each widgets , return mashup view response.
on client side, on success of ajax call, replace entire dashboard/widget area data received response.
Comments
Post a Comment