Reputation: 79
I have a jquery modal on my page[parent aspx]. The div which opens has an iframe in it. I set the source on modal open function which is actually another aspx page with some values from my parent aspx.
Now other aspx page takes time to display formatted results back from an external datasource. Hence the modal window opens and user has to wait before content is loaded.
Is it possible to display a label like wait or working or anyother gif till the aspx page returns values.
Edited to add:-
function openDialog() { var url = "result.aspx?NAME=" + encodeURIComponent($("#<%=txtcity.ClientID %>").val()) + "&Type= " + encodeURIComponent($("#<%=txtType.ClientID %>").val()) ;
$("#popup").attr("src", url);
$("#carModal").dialog('open');
}
}
My div is as below:
<div id="carModal" >
<iframe id ="popup" width ="100%" height="100%"></iframe>
</div>
In the onload of result.aspx I pass the two values to external service and map the result to GridView. This is what takes time to load. The jquery popup comes without any data loaded as the result.aspx on lad is still working. I also return the grid row values to parent page and populate controls
Upvotes: 0
Views: 1440
Reputation: 11568
usually in your .ajax function you can make a hidden loading gif (display:none in css) to appear and make it hidden again the success callback function. It would be easier to assist you if you paste some of your jQuery code/aspx here.
Also refer to this post as well which can give you more information
Upvotes: 1