惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
About on SuperTechFans
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
宝玉的分享
宝玉的分享
美团技术团队
量子位
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
IT之家
IT之家
爱范儿
爱范儿
J
Java Code Geeks
博客园 - Franky
Last Week in AI
Last Week in AI
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
InfoQ
GbyAI
GbyAI
Recent Announcements
Recent Announcements
小众软件
小众软件
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog

博客园 - gucs

《应用框架的设计与实现——.NET平台》书评 《WCF Unleashed》的 AzRoles 演示代码 Tech Ed 2009,胡思乱想 Mac 双系统的时间设置问题 使用 gVim 遇到的第一个问题 Google notebook for Firefox 3.5 Fiddler & localhost 关于 TableLayoutPanel 的 Scroll bar Powerdesigner 12.5 对 SQL Server 2005 做反向工程时发生错误 VisualSVN Server 的 Apache 配置 ExplorerXP 在 Vista 下的设置 ReSharper 2.0.4 安装时的 1722 错误 禁用 Nero ShowTime 快捷键 NHibernate 和 ODP.NET 手动注册 DevExpress 8.2.3 控件到 Visual Studio 工具箱 PPStream caused an Access Violation (0xc0000005) in module VSFilter.dll at 001b:07610441. 隐藏 Windows Vista 的 Explorer 菜单栏 ReadOnly Controls do not post back properly 使用 ExtJs Extender Controls 遇到的第一个错误
使用 ModalPopupExtender 和 UpdatePanel 应注意的问题
gucs · 2008-11-18 · via 博客园 - gucs

项目中使用 ASP.NET Ajax,也使用了 AjaxToolkit 中的 ModalPopupExtender 控件。

在开发中遇到了这个错误信息:Sys.InvalidOperationException: Handler was not added through the Sys.UI.domEvent.addHandler method。通过 Google 找到了这个帖子,按照老外的方法搞定了该问题,原文引用如下:

This issue seems to stem from the fact that the ModalPopupExtender is not expecting to have the Ok and Cancel controls in the update panel.  Normally, you cannot define and Code Behind for these Buttons click events.  So when you Click on these buttons, and they post back to the server, something is broken between the ModalPopupExtender and the buttons.  By defining dummy buttons to take their place, it will make the web page stop throwing the javascript exception.  Even though the buttons are invisible, and do not do anything.

I hope this helps.

用一句来说:不要将 ModalPopupExtender 控件的 OK 和 Cancel 控件放在 UpdatePanel 中。