I have my asp button on which I am validating some data and then firing its server side function it is working fine it looks like this
<asp:Button CssClass="btnRequestFile" ID="btnSave" runat="server" Text="Request"
OnClientClick="if(clientValidate() == false) return false;" OnClick="btnSave_Click" />
So on my client side function I want to show a loading panel but the loading panel does not appear until there is some alert being fired here is my code:
function clientValidate() {
// $("#IDData").html('');
$.loading({ align: 'center', delay: 0, img: '../common/Content/images/shared/sq_loader_3.gif', onAjax: false, pulse: false });
$("#divLoadingImg").show();
alert("dfhdfh");
var isValid = false;
var objectData = null;
var liTags = $('#' + secondContainer).find('li');
if (liTags.length == 0) {
alert('Please select at least one question !');
}
else {
if (SaveConfiguration()) {
//alert('error occurred');
}
else {
//alert('error free');
isValid = true;
}
}
$("#divLoadingImg").hide();
$.loading(false);
return isValid;
}
I am using jquery.loading.min.js
to show the loading panel it is not working also I have tried to place a div in markup and just show hide it as a loading but to no avail any suggestion how it could be done.
EXPLANATION:
document.onload=hide_loading_div();
code hides the panel.<body onload="hide_loading_div()">
Note: If you want to block only a part of the page with a panel like loading div, the container div -which will 'dim out'- must have `position:relative;' attribute and the blocker div must have 'position:absolute' attribute (not fixed).
place a dive ther "sonu" and give it some id
and in jquery write;
place your loding gif in the dive