[問題] UpdateProgress 控制項
小弟在asp.net網頁原始檔UpdatePanel控制項內放置一段圖片連接:如下
<span style="font-weight: bold; font-size: 12pt">資料建檔</span>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<img src="<%=ResolveClientUrl("~/Images/loading.gif") %>" alt="" />
<span style="vertical-align: bottom;
padding-left: 10px; padding-right: 5px">請稍候...</span>
</ProgressTemplate>
</asp:UpdateProgress>
正常情況下都可以引發一個正在工作中的圖片
現在有一個button 控制項,小弟在code 裡面加了這一段:如下
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ScriptManager1.RegisterPostBackControl(btnExport);
}
}
protected void btnExport_Click(object sender, EventArgs e)
{
前略......
#region Post file to client
if (!IsError)
{
Response.AppendHeader("Content-Disposition", string.Format
("attachment;filename={0}", Server.UrlEncode
(System.IO.Path.GetFileName(strFileName))));
Response.ContentType = "application/vnd.ms-access";
Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
Response.WriteFile(strFileName);
Response.Flush();
Response.Close();
}
#endregion
}
這樣就不會跑出工作中的圖片,請問有何改進的辦法?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.69.191.1
※ 編輯: ONLYSMART 來自: 210.69.191.1 (12/26 11:46)
→
12/26 16:33, , 1F
12/26 16:33, 1F
→
12/26 16:34, , 2F
12/26 16:34, 2F
→
12/26 16:34, , 3F
12/26 16:34, 3F
→
12/26 16:40, , 4F
12/26 16:40, 4F
→
12/26 16:40, , 5F
12/26 16:40, 5F
→
12/26 16:40, , 6F
12/26 16:40, 6F
→
12/26 18:11, , 7F
12/26 18:11, 7F
→
12/26 18:11, , 8F
12/26 18:11, 8F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章
-50
111