CSS
<style type="text/css"> #UpdateProgress1 { top:450px; left: 450px; position: absolute; background-color: #C3E1FF; background-repeat: repeat-x; } </style>
Add scriptManager, UpdatePanel as shown below:
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <table runat="server" border="1" width="98%" align="center"> <tr><td></td></tr> </table> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"> <ProgressTemplate> <img src="Images/Loading.gif" /><br /><center><font color=red>Processing Data...</font></center> </ProgressTemplate> </asp:UpdateProgress> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnprocess" /> </Triggers> </asp:UpdatePanel>
And then give some timer
System.Threading.Thread.Sleep(3000);
If you use Simple JQuery, you need to do an ajax way, and here is how you should do with ajax:
$('#ShowDiv') .hide() // hide .ajaxStart(function() { $(this).show(); }) .ajaxStop(function() { $(this).hide(); });
coder source share