UpdatePanel中的Response.Write()问题

在 UpdatePanel 控件中使用 Response.Write()输出用户提示信息,但无论如何都没有反应,原因是UpdatePanel 无刷新而Response.Write()需要刷新,这会扰乱 UpdatePanel 的执行过程,经网上查询,解决的办法如下,做个备忘:

用下面的方法代替 Response.Write():
System.Web.UI.ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "alert('Hello Word!')", true);

posted @ 2017-08-30 10:19  毅往无前  阅读(338)  评论(0编辑  收藏  举报