When user click on "Send", "Submit", "Save" or "OK" button, page starts process for postback and user did net get idea whats going on,
Some time when there is lots of data are transferring; we need to create user friendly web application to get idea to user that still its working please wait for some time.
Using only javascript to so process or fire some function when user click on submit button, after check validations or before checking validation.
A button on page:
One hidden div tag with processing image:
Now one javascript function:
that all; now when user click on submit button; it will check validations first; else it will show that image;
the javascript function name is "WebForm_OnSubmit" which fires every time when user clicks on Submit button.
Some time when there is lots of data are transferring; we need to create user friendly web application to get idea to user that still its working please wait for some time.
Using only javascript to so process or fire some function when user click on submit button, after check validations or before checking validation.
A button on page:
asp:button runat="server" id="btnSave" onclick="btnSave_Click">
One hidden div tag with processing image:
div id="divProcess" class="goProcess">
img src="http://www.blogger.com/images/bigrotation2.gif" alt="Image" />
/div>
Now one javascript function:
script language="javascript" type="text/javascript">
function WebForm_OnSubmit() {
if (typeof (ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) {
return false;
}
else {
document.getElementById("divProcess").style.display = "block";
return true;
}
}
/script>
that all; now when user click on submit button; it will check validations first; else it will show that image;
the javascript function name is "WebForm_OnSubmit" which fires every time when user clicks on Submit button.
Hi sam, What about the javascript function should we override the existing function?
ReplyDelete