Click here to Skip to main content
15,921,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I want to show loading gif near to asp:button ,when the page get postback ,
I am not using updatepanel and also dont want to use it.

I have wriiten code as
 <div id="divShowLoadingGif"  runat="server"  style="display:none; ">
        <img id="img2" alt="" src="Ajax_spinner.gif" style="display: inline; height: 16px;" />
       </div>

<asp:Button ID="btnUpload" runat="server" ValidationGroup="u"  OnClick="btnUpload_Click" OnClientClick="showloadingGif_UPLOAD();return true;"  Text="Upload"  />


javascript code
C#
function showloadingGif_UPLOAD() {

     
      document.getElementById('divShowLoadingGif').style.display = 'inline';
      return true;
  }


and the server side code
C#
protected void btnUpload_Click(object sender, EventArgs e)
  {

// my code here

  }


my code is working in IE AND MOZILLA but its not working in google chrome .
In google chrome only clientside code is getting exucuted but server side code is not getting executed.

I have several button where i want to show loading gif near to the asp.net button whenver user click asp.net button

Please help
Posted

1 solution

try asp progress bar in place of java script function.
 
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