How to put loading image when something is processing?

asp.net, c#

Solution

Without Ajax Tool: This will call the loading image on button click and hide the image on page load completes.

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
      function ShowProgressBar() {
        document.getElementById('dvProgressBar').style.visibility = 'visible';
      }

      function HideProgressBar() {
        document.getElementById('dvProgressBar').style.visibility = "hidden";
      }
    </script>
</head>
<body onload="javascript:HideProgressBar()" >
    <form id="form1" runat="server">
     <div>
  <div style="float:left;">
      <asp:Button ID="btn_createlink" runat="server" Text="Create link" OnClick="btn_createlink_Click" OnClientClick="javascript:ShowProgressBar()" />
  </div>
  <div ID="dvProgressBar" style="float:left;visibility: hidden;" >
        <img src="/images/progress_bar.gif" /> resolving address, please wait...
  </div>
  <br style="clear:both" />
</div>
    </form>
</body>
</html>

Problem

I am having page in that when we click on create button its sends web request to get the all links but mean while it takes some time to get all links working or not so at that time I want to put image load ``` Button ID="btnRender" runat="server" Text="Page Render" OnClick="btnRender_Click" /> <asp:Button ID="btn_submit" runat="server" Text="Submit" OnClientClick="javascript:finda();" /> <asp:Button ID="btn_createlink" runat="server" Text="Create link" OnClick="btn_createlink_Click" /> ``` i want to call on btn_createlink_Click" button when user clicks the image or text should appear

Original source

Related problems