更新進度不起作用。代碼如下,當我點擊網格中的任何按鈕(分頁,過濾等)時,進度正在工作。但是當我點擊圖像按鈕時,進度不工作。在母版頁 更新進度不起作用
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upnlStockList"
DisplayAfter="0" DynamicLayout="true">
<ProgressTemplate>
<div class="PopupPanel">
<table style="vertical-align: middle; width: 100%; height: 900px">
<tr>
<td valign="middle" align="center">
<img id="Img1" src="~/Images/loading.gif" runat="server" />
</td>
</tr>
</table>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="upnlStockList" runat="server" ChildrenAsTriggers="true" UpdateMode="Always">
<ContentTemplate>
<grid></grid>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="imgPDF" />
<asp:PostBackTrigger ControlID="imgExcel" />
<asp:PostBackTrigger ControlID="imgCSV" />
</Triggers>
</asp:UpdatePanel>
protected void imgExcel_Click(object sender, ImageClickEventArgs e)
{
(initializing the report and assigning parameter).
ReportProcessor reportProcessor = new ReportProcessor();
RenderingResult result = reportProcessor.RenderReport(PDF, rptStockList, null);
string fileName = result.DocumentName + ".pdf";
Response.Clear();
Response.ContentType = result.MimeType;
Response.Cache.SetCacheability(HttpCacheability.Private);
Response.Expires = -1;
Response.Buffer = true;
Response.AddHeader("Content-Disposition", string.Format("{0};FileName=\"{1}\"", "attachment", fileName));
Response.BinaryWrite(result.DocumentBytes);
Response.End();
}
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
腳本管理器通過點擊圖像按鈕我下載該報告爲PDF格式。
你在你的代碼有ScriptManager的地方嗎? – maxisam 2011-12-28 04:29:36
謝謝你的回覆.....是...在母版頁和進度使用網格動作(分頁,過濾) – 2011-12-28 04:32:54
調試你的按鈕點擊事件。檢查它是否正在開火。 – RajeshKdev 2011-12-28 04:43:03