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

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -