ASP.NET 網頁顯示執行中的圖示 使用 AJAX

在ASPX裡加上下列語法:
<!– ScriptManager –>
<asp:ScriptManager runat=”server”>
</asp:ScriptManager>

<!– show出執行中的圖片 –>
<asp:UpdateProgress runat=”server” ID=”UpdateProgress1″>
<ProgressTemplate>
<img id=”processing1″ src=”../opto_pictures/icon_processing.gif” style=”z-index: 1″ />
</ProgressTemplate>
</asp:UpdateProgress>

<!– 哪個動作淤要非同步作業,通常都用UpdatePanel –>
<asp:UpdatePanel runat=”server” ID=”UpdatePanel1″>
<ContentTemplate>
<asp:Button runat=”server” Text=”跑很久”></asp:Button>
</ContentTemplate>
</asp:UpdatePanel>

可以很多個UpdatePanel顯示一個 UpdateProgress的圖片,
若多個UpdatePanel與多個UpdateProgress,其中有一個UpdatePanel要連動某一個UpdateProgress,
可在UpdateProgress的屬性使用AssociatedUpdatePanelID=”UpdatePanel的ID”,
作為兩者間唯一的連動,而不被其他所影響。

 

by mhchen15 on 4 12 月, 2012 in ASP.NET C#, 程式 - Tags: ,
Tags: ,

There are no comments.

Name*: Website: E-Mail*:
XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>