Meh*_*hin 71
你可以使用的endRequest
事件PageRequestManager
.
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button runat="server" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
<script type="text/javascript">
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function (s, e) {
alert('Postback!');
});
</script>
Run Code Online (Sandbox Code Playgroud)
Pad*_*ddy 25
您可以使用ClientScriptManager在重新加载时调用函数:
ClientScriptManager.RegisterStartupScript(this.GetType(), "AKey", "MyFunction();", true);
Run Code Online (Sandbox Code Playgroud)
http://msdn.microsoft.com/en-us/library/asz8zsxy.aspx
Min*_*iel 11
只是
<script type="text/javascript">
function pageLoad() {
}
</script>
<asp:ScriptManager runat="server" />
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Button runat="server" ID="Button1" />
<asp:Literal runat="server" ID="TextBox1" />
</ContentTemplate>
</asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud)
每次触发Button1时,将继续调用pageLoad()
尝试这个:
$.ajax({
beforeSend: function(){
// Handle the beforeSend event
},
complete: function(){
// Handle the complete event
}
// ......
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
86727 次 |
最近记录: |