QUESTION
Can anyone suggest how a loading image can be displayed until a gridview is fully loaded?
This gridview is to be rendered on page
You should load grid in another page and call that page in a div on parent page and display required loading image while loading div as per below code:
$(document).ready(function()
{
$("#loader").show();
$.ajax({
type: "GET",
url: "LoadGrid.aspx",
data: "{}",
contentType: "application/json",
dataType: "json",
success: function(data) {
$("#loader").hide();
$(#dvgrid).html(data);
},
// it's good to have an error fallback
error: function(jqhxr, stat, err) {
$("#loader").hide();
$(#dvgrid).html('');
$("#error").show();
}
});
});
In LoadGrid.aspx you should load grid by normal C# code. and simply your parent page will call the LoadGrid.aspx and rendered html will display in parent div with loading image...