关于上一问中的ajax与验证控件冲突问题的解决方法

这是微软的一个Bug,你去官网下载一个Validators.dll,放到bin目录下,然后在Web.Config里加上(configuration/system.web/pages节点中添加(或修改)如下的元素)
<tagMapping>
<add tagType="System.Web.UI.WebControls.CompareValidator"            mappedTagType="Sample.Web.UI.Compatibility.CompareValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.CustomValidator"             mappedTagType="Sample.Web.UI.Compatibility.CustomValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RangeValidator"              mappedTagType="Sample.Web.UI.Compatibility.RangeValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Sample.Web.UI.Compatibility.RegularExpressionValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RequiredFieldValidator"      mappedTagType="Sample.Web.UI.Compatibility.RequiredFieldValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.ValidationSummary"           mappedTagType="Sample.Web.UI.Compatibility.ValidationSummary, Validators, Version=1.0.0.0"/>
   </tagMapping>

posted @ 2008-03-12 17:48  netkey码  阅读(101)  评论(0编辑  收藏  举报