2011-02-16 75 views
0

我想調用JavaScript函數來在UpdatePanel中更改DropDownList時顯示/隱藏加載動畫。ASP.NET UpdatePanel和JavaScript函數

這裏是一個UpdatePanel

<asp:UpdatePanel ID="UpdatePanel4" runat="server"> 
    <ContentTemplate> 
    <asp:DropDownList ID="ddl_size" runat="server" OnSelectedIndexChanged="ddl_size_SelectedIndexChanged" AutoPostBack="true">/asp:DropDownList> 
    ... 

這裏DopDownList是JavaScript函數我想打電話給

function ShowLoadingAnimation() { ... } 
function HideLoadingAnimation() { ... } 

難道我使用觸發器?我如何使用它?提前致謝。

回答

0

將這個代碼在JavaScript代碼在你的aspx頁面:

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler); 
function endRequestHandler() { yourJsFunction }