首页 > 代码库 > 关于Ajax后台服务程序

关于Ajax后台服务程序

问题:

1     public void Alert(string msg)
2     {
3         ClientScript.RegisterStartupScript(this.GetType(), null, "alert(‘" + msg + "‘)", true);
4         //前端不会显示警告信息
5     }

解决方法:

1     public void Alert(string msg)
2     {
3         //ClientScript.RegisterStartupScript(this.GetType(), null, "alert(‘" + msg + "‘)", true);
4       //修改为  
5         ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "", "alert(‘!‘);", true);
6     }

至于为什么,还不太清楚,先这么用着,挖个小坑!!!

关于Ajax后台服务程序