超出UpdatePanel错误消息未显示 [英] Out of UpdatePanel Error message not showing
本文介绍了超出UpdatePanel错误消息未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用UpdatePanel进行一次Gridview(panel1)它工作正常,即使上面的文本验证(panel2)警告信息没有显示,这里使用javascrip alert pop
给出任何想法。 。 。
谢谢!
Hi,
I'm using UpdatePanel for one Gridview(panel1) it's working fine even though above text Validation(panel2) alert message not showing, here using javascrip alert pop
Give any idea for that . . .
thank You!
推荐答案
ClientScript.RegisterClientScriptBlock
和ClientScript.RegisterStartupScript
使用AJAX UpdatePanel时,从服务器端注册JavaScript代码的方法不起作用。您需要使用ScriptManager的RegisterClientScriptBlock
和RegisterStartupScript
方法,因为它们支持Partial PostBack,因此JavaScript已注册并执行。
参考文献:
在ASP.Net中的AJAX UpdatePanel内显示JavaScript警报消息 [ ^ ]
更新面板内的Javascript警报 [ ^ ]
ClientScript.RegisterClientScriptBlock
andClientScript.RegisterStartupScript
methods for registering JavaScript code from server side do not work when AJAX UpdatePanel is used. You need to use ScriptManager’sRegisterClientScriptBlock
andRegisterStartupScript
methods as they support Partial PostBack and hence the JavaScript is registered as well as executed.
References:
Show JavaScript Alert Message inside AJAX UpdatePanel in ASP.Net[^]
Javascript Alert inside Update Panel[^]
这篇关于超出UpdatePanel错误消息未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文