这两种PostBackTrigger有什么不同?
问题描述:当程序调用Response.write不能正常显示,报出如下错误:
Sys.WebForms.PageRequestManagerParserErrorException:The message received from the server count not be parsed.Common causes for this error are when the response is modified by calls to response.Write(),response filters,HttpModules,or server trace is enabled.
Details:Error parsing near '
由于页面中加入了UpdatePanel,而且按钮的事件在UpdatePanel里面且有类似Response.write("")语句。
解决办法:
将按钮置于UpdatePanel外,在UpdatePanel的属性中添加PostBackTrigger,ControlID为该按钮即可。