私は Visual Studio 2008 を使用して ASP.NET サイトを構築しており、ページは次のようになっています (一部省略)。
<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 は長い (>5 秒) プロセスを開始します
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LongRunningProcess();
}
}
LongRunningProcess の実行中に UpdateProgress を表示するにはどうすればよいですか? LongRunningProcess() 呼び出しをボタンの onclick ハンドラーに移動すると機能します。