Page_ClientValidate出现问题 [英] Trouble with Page_ClientValidate

查看:137
本文介绍了Page_ClientValidate出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序是在VB.net中构建的。我动态添加文本框和RequiredFieldValidator。验证组的名称是vgFormVals。



在我的页面上,我执行此功能



如果(Page_ClientValidate(''vgFormVals''))返回false;



没有填写必填字段。该函数无法返回false。



我在页面上也有树视图。如果我首先在树视图中选择一个节点,然后运行上面的函数,它就可以工作。



提前致谢。

My application is built in VB.net. I dynamically add textboxes and RequiredFieldValidator. The name of the validation group is vgFormVals.

On my page, i execute this function

if (Page_ClientValidate(''vgFormVals'')) return false;

without ever filling in the required fields. The function fails to return false.

I also have a treeview on the page. If I select a node in the treeview first and then run the function above, it works.

Thanks in advance.

推荐答案

发现我的问题。我的一些必需的验证器字段在id中有空格。例如id =rfv somevalue。解决这个问题解决了我的问题,但没有解释为什么它适用于我上面提到的其他场景。
Found my issue. Some of my required validator fields had white space in the id. For example id = "rfv somevalue". Fixing this fixed my problem, but doesnt explain why it works in the other scenario I mentioned above.


这篇关于Page_ClientValidate出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆