I have a webform application with master page, I want when user initiate any task in the website the loader image will show with modal screen untill the task is finished.
below is my master page code.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<%-- Start of wating message --%> <%--Loading progress--%>
<script type="text/javascript">
$("#MasterFormID").submit(function () {
$("body").addClass("loading disp");
$("#modal").addClass("disp");
});
</script>
<%-- End of wating message --%>
CSS
<style type="text/css">
.modal {
display: none;
position: fixed;
z-index: 1000;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: rgba( 255, 255, 255, .8 )
url('../Asset/Loading.gif')
50% 50%
no-repeat;
}
.loading {
overflow: hidden;
}
.disp {
display: block;
}
</style>
within the formID in the master page
<form id="MasterFormID" runat="server">
<div id="modal" class="modal" style="text-align: center">
</div>
But this is not loading the load image, and I can't figure out what went wrong, and this is my first time I am trying this, please anyone can help
thats.
What I have tried:
I tried placing the code on every page page_load but it did not work out.