我需要幫助。點擊一個按鈕後,我會觸發一個進度條。這個按鈕在SQL中運行存儲過程,它將更新我以後爲gridview綁定的表,在運行存儲過程後執行代碼更新gridview。問題是,在進度條出來後,我預計gridview會自動刷新/更新,但沒有發生。請幫忙。帶有GridView和Progressbar的UpdatePanel無法正常工作
ASPX - GridView控件:
<asp:Panel ID="Panel1" runat="server" HorizontalAlign="Center">
<asp:UpdatePanel ID="UpdatePanel9" ChildrenAsTriggers="false" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<table cellpadding="0" cellspacing="0">
<asp:GridView ID="GridExportExcel" runat="server" >
...........Blah
</table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnExecSP" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</asp:Panel>
進度條:從後面的按鈕
<asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="false">
<ProgressTemplate>
<asp:Image ID="loading" runat="server" ImageUrl="loading.gif" />
</ProgressTemplate>
</asp:UpdateProgress>
代碼: - 此存儲過程運行約3分鐘。
DataTable dt = new DataTable();
GridExportExcel.DataSource = dt;
GridExportExcel.DataBind();
//UpdatePanel9.Update();
string connectionString = WebConfigurationManager.ConnectionStrings["SQLConnectionString"].ConnectionString;
string selectSQL = "exec dbo.StoredPRoc'" + txtcomp.Text + "','" + TextBox2.Text + "'";
DataTable DT = new DataTable();
DT = ExecGetData(selectSQL);
header(); //Update the Gridview.
謝謝 - 倫茲
喜布賴恩感謝您的答覆。我不允許在表中創建索引。我做了一些工作,並刪除了進度條,它工作正常,但查詢/ storedproc仍然在3分鐘內執行。 GridView正在更新。如何在不超時的情況下顯示進度欄?有沒有辦法做到這一點?我很感激你的回覆。提前致謝。
顯示您的代碼,請... – wizzardz 2013-05-02 04:00:20
嗨Wizzardz請參閱上面的代碼。謝謝。 – renzmar 2013-05-02 05:21:49
@wizzardz有什麼想法嗎? – renzmar 2013-05-03 02:05:46