Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi all,

I am working on a web application where I want to show a loading image (busy indicator) when my code create a xml file and download it I want to show the image in a div. I should use c# code only not update panel nor the jquery ajax technique. My code looks like:

protected void lb_DownloadXML_Click(object sender, EventArgs e)
{
this.imgLoading.Visible = true;
//all my code
this.imgLoading.Visible = false;
}

my image is

<img src="Images/loading_big.gif" width="50" height="40" runat="server" id="imgLoading"
visible="false" />


but its not working. Can anybody explain me how can I achieve this task.

thanks in advance.
Posted
Comments
pankajupadhyay29 17-Jan-12 3:15am    
try to show that image on ClientClick of lb_DownloadXML using javascript.
demouser743 17-Jan-12 3:50am    
what you mean by this code

this.imgLoading.Visible = true;
this.imgLoading.Visible = false;

showing the image and again setting it to false this will not work in any case.. Try by removing this this.imgLoading.Visible = false;

1 solution

Try by removing the following in your code

C#
protected void lb_DownloadXML_Click(object sender, EventArgs e)
      {
            this.imgLoading.Visible = true;
            //this.imgLoading.Visible = false; (Comment or delete this statement)
      }
 
Share this answer
 
Comments
tanweer 17-Jan-12 4:22am    
actually I want to hide the image after downloading the file successfully.
demouser743 17-Jan-12 4:28am    
Then add a bit of javascript adding some time to it

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