在后面显示使用C#代码加载图像 [英] show loading image using c# code behind
问题描述
大家好,
我在一个Web应用程序上工作,我想在代码创建xml文件并下载时显示加载图像(繁忙指示器),我想在div中显示图像.我应该只使用c#代码而不是更新面板或jquery ajax技术.我的代码如下:
受保护的void lb_DownloadXML_Click(对象发送者,EventArgs e)
{
this.imgLoading.Visible = true;
//我所有的代码
this.imgLoading.Visible = false;
}
我的形象是
< img src ="Images/loading_big.gif" width ="50" height ="40" runat ="server" id ="imgLoading"
visible ="false"/>
但它不起作用.谁能解释我如何完成这项任务.
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.
推荐答案
尝试通过删除代码中的以下内容
Try by removing the following in your code
protected void lb_DownloadXML_Click(object sender, EventArgs e)
{
this.imgLoading.Visible = true;
//this.imgLoading.Visible = false; (Comment or delete this statement)
}
这篇关于在后面显示使用C#代码加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!