我使用Visual Studio 2008中,有一個頁面看起來像這樣(的東西剪斷)ASP.NET 3.5:的Page_Load()中顯示的UpdateProgress
<asp:Content ID="Content2" ContentPlaceHolderID="PageContentPlaceHolder" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
the page here..
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="100">
<ProgressTemplate>
<div>
<asp:Image ID="AjaxImage" runat="server" ImageUrl="Ajax.gif" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</asp:Content>
在Page_Load開始長(構建ASP.NET網站> 5s)過程
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LongRunningProcess();
}
}
如何在LongRunningProcess正在運行時顯示UpdateProgress?當我將LongRunningProcess()調用移動到按鈕onclick處理程序時,它可以工作。
嗨@JBrooks,我有同樣的問題,並試圖理解你的解決方案。我用加載圖像創建了div。阿洛斯有Javascript頁面加載方法,現在我想知道在getVersions和** LoadVersionsCallback **中寫什麼?我正在使用框架4.0,這個解決方案在4.0中也有用嗎? – user1181942 2012-04-02 07:27:14