验证未执行 [英] validation not performing
问题描述
大家好,
我的项目中有一个用户个人资料页面
在其保存按钮上,onclient单击我正在调用javascript函数,并且在同一页面上有一个必填字段,我使用了必填字段验证器,并且验证组与保存按钮相同,但由于客户端而无法使用单击javascript函数.我删除它正在工作.我想同时保留两个..
请给我建议一个更好的方法...
这是该按钮代码:-
hi to all,
i have one user profile page in my project
on its save button, onclient click i am calling a javascript function and in the same page there is a field of password that is mandatory, i have used required field validator and validation group is as same as save button but its not working due to client click javascript function. it i remove it it is working. i want to keep both ..
please suggest me a better way...
here is that button code:-
<asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="~/buttons/save.jpg"
onclick="ImageButton3_Click" ValidationGroup="Submit" OnClientClick="return CheckForTestFile();" />
只有return CheckForTestFile();
运行良好
但ValidationGroup ="submit"无法正常运行
在此先感谢
only return CheckForTestFile();
working well
but ValidationGroup="submit" not working
thanks in advance
推荐答案
在客户端方法中使用它来触发验证器
Use this in the client-side method to trigger the validators
if(typeof (Page_ClientValidate) == 'function')
Page_ClientValidate();
if(!Page_IsValid)
{
// Do something
}
这篇关于验证未执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!