您的位置:首页 > Web前端 > JavaScript

js 后台异步执行

2015-12-04 15:54 381 查看
public void AlertMsg(string msg, bool async)
{
string script = string.Format("alert('{0}'); ", msg);
RegisterClientScript(script, async);


public void RegisterClientScript(string script, bool async)
{
if (async)
{
System.Web.UI.ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Guid.NewGuid().ToString(), script, true);
}
else
{
this.Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), script, true);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: