[問題] UpdateProgress 控制項

看板C_Sharp (C#)作者時間13年前 (2011/12/26 11:45), 編輯推噓0(008)
留言8則, 2人參與, 最新討論串1/2 (看更多)
小弟在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:34, , 2F
otnet/17886.html
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, , 6F
upload.html
12/26 16:40, 6F

12/26 18:11, , 7F
用<Triggers>的效果跟加Code一樣,不會跑出來。
12/26 18:11, 7F

12/26 18:11, , 8F
感謝F大的回答!
12/26 18:11, 8F
文章代碼(AID): #1Ez-tId6 (C_Sharp)
文章代碼(AID): #1Ez-tId6 (C_Sharp)