通过本文主要向大家介绍了分页控件 asp.net,表格控件 asp.net,用户控件 asp.net,日期控件 asp.net,js获取asp.net控件等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
经过查找网上的资料,发现好像是它本身的一个问题,原文如下:
With ASP.Net, I need to submit twice when using the RequiredFieldValidator in a FCKeditor instance
FCKeditor will not work properly with the Required Field Validator when the "EnableClientScript" property of the validator is set to "true" (default). Due to a limitation in the default validation system, you must set it to "false".
If you want to do client side validation, you must use a Custom Validator instead and provide the appropriate validation function, using the FCKeditor JavaScript API.
译文如下(翻译的不好,大家能看懂就好):
问:为什么在使用ASP.NET的RequiredFieldValidator时,我需要提交两次
答:当RequiredFieldValidator的EnableClientScript属性被设置成true时,FCKEditor不能很好的支持RequiredFieldValidator,为了解除这个限制,你必须把这个属性设置成为false 如果你希望使用客户端验证,你必须使用Custom Validator制作一个非空验证来替换RequiredFieldValidator,在其中使用FCKeditor JavaScript API即可。
看了这篇文章,我就去找FCKeditor JavaScript API的文档,发现它为客户端JavaScript的调用提供了一些属性和方法,于是乎,就按上述的回答写了一段JavaScript脚本来完成了验证。
详细解决方法:首先添加Javascript脚本:
这样,再试试,OK,一次就可以直接提交了,不会出现提交两次的bug了 </div>
With ASP.Net, I need to submit twice when using the RequiredFieldValidator in a FCKeditor instance
FCKeditor will not work properly with the Required Field Validator when the "EnableClientScript" property of the validator is set to "true" (default). Due to a limitation in the default validation system, you must set it to "false".
If you want to do client side validation, you must use a Custom Validator instead and provide the appropriate validation function, using the FCKeditor JavaScript API.
译文如下(翻译的不好,大家能看懂就好):
问:为什么在使用ASP.NET的RequiredFieldValidator时,我需要提交两次
答:当RequiredFieldValidator的EnableClientScript属性被设置成true时,FCKEditor不能很好的支持RequiredFieldValidator,为了解除这个限制,你必须把这个属性设置成为false 如果你希望使用客户端验证,你必须使用Custom Validator制作一个非空验证来替换RequiredFieldValidator,在其中使用FCKeditor JavaScript API即可。
看了这篇文章,我就去找FCKeditor JavaScript API的文档,发现它为客户端JavaScript的调用提供了一些属性和方法,于是乎,就按上述的回答写了一段JavaScript脚本来完成了验证。
详细解决方法:首先添加Javascript脚本:
这样,再试试,OK,一次就可以直接提交了,不会出现提交两次的bug了 </div>