平时后台弹出对话框而不影响前台布局:
this.ClientScript.RegisterStartupScript(this.GetType(), "script", "<script type='text/javascript'>alert('查不到相关结果!');</script>");
要是前台有局部刷新以后上面的就没用了。得这么写了:
ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "OK", "alert('添加成功!');", true);