Bil*_*rty 11 javascript c# asp.net
在更新面板刚刚刷新后,如何加载javascript命令(如onload或onclick或其他东西).
小智 15
在javascript标记上嵌入这些行
function foo()
{
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler);
}
function endRequestHandler(sender, args)
{
// Do your stuff
alert('Update Panel routine is now complete');
}
Run Code Online (Sandbox Code Playgroud)
然后,把它放在你的身体标签上
<body onload="foo()">
Run Code Online (Sandbox Code Playgroud)
ScriptManager.RegisterClientScriptBlock(upPanel, upPanel.GetType(), "alert('hello world')", true);
Run Code Online (Sandbox Code Playgroud)
你必须在部分回发时调用它.
| 归档时间: |
|
| 查看次数: |
18951 次 |
| 最近记录: |