Click here to Skip to main content
15,669,039 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi friends,

am working on c#, Sqlserver 2005.

I have a button on my webpage, when i click this button it must display. Loading Please wait.

Please can you help me.

Updated 13-Jan-19 19:17pm

Share this answer
The easiest approach is to use jQuery or Javascript to disable any / all elements within your page after your Button was clicked and display your image. I'll provide a very basic example using the jQuery library below :

<!-- Example jQuery Script -->
<script src="//"></script>
<script type='text/javascript'>
      // When a Button is clicked on your page, disable everything and display your loading element
          // Disable everything
          // Display your loading image (centered on your screen)
          $('body').append("<img style='top: 45%; position: absolute; height: 100px; width: 100px;background: black;left: 45%;' src='' />");

As an alternative, you can try something like this as well:

<div id="divWait" style="position:absolute;left:50%; top:50%; margin:-100px 0 0 -150px; display:none;">
      <div style="text-align:center; width:300px; height:70px; background-color:#000; color:#fff;">
              <!--Your GIF image here-->

<div id="divHolder">
      <!--Put your content here and form elements-->
<asp:LinkButton ID="lnkSave" runat="server" CssClass="lnkSave" />

<script type="text/javascript">
        $("#divWait").css({'display': 'block'});
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900