c# - Load partial view after main view -
i have several partial views have been added main view on mvc site. 1 of partial views takes long time load however, can take while retrieve data it. possible load main view , start loading partial views, if view still loading display rest in meantime, final 1 showing once has finished?
on similar note, while partial view loading (or being refreshed) how can kind of "loading" screen show on view area user knows happening?
thanks
try below codes
$.ajax( { url: '/controller/action', data: { id: '1' }, //input parameters action beforesend: function () { $('#div-result').show(); var img = '<img src="../../images/loading.ico" />'; $('#div-result').html(img); }, success: function (data) { // $('#div-result') -> div in main view $('#div-result').html(data); } });
Comments
Post a Comment