猿问

在AJAX中怎样实现调用后台方法AA()?

<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>    
                
                <asp:Timer ID="Timer1" runat="server" Interval = "1000"></asp:Timer>  
          <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                <ProgressTemplate >
                图片读取中......
                </ProgressTemplate>
                </asp:UpdateProgress>
            </ContentTemplate>
        </asp:UpdatePanel>

在每次定时刷新后,希望调用后台的AA(),怎样实现?


红颜莎娜
浏览 385回答 2
2回答

皈依舞

直接为timer绑定触发的方法即可。protected void Timer1_Tick(object sender, EventArgs e) &nbsp; &nbsp;{ &nbsp; &nbsp; &nbsp; &nbsp;//方法体 &nbsp; &nbsp;}调用AA()的话。在这个触发的方法里面调用吧。

智慧大石

protected void Timer1_Tick(object sender, EventArgs e) &nbsp; &nbsp;{ &nbsp; &nbsp; &nbsp; &nbsp;AA(); &nbsp; &nbsp;}public void AA(){}
随时随地看视频慕课网APP
我要回答