在文本框的编辑值之后,RegularExpressionValidator得到valid = false [英] RegularExpressionValidator get valid=false after edit value of the textbox

查看:74
本文介绍了在文本框的编辑值之后,RegularExpressionValidator得到valid = false的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

请提出建议,


在这里,我使用regularExpressionValidator来验证测试框的值,
在添加值然后保存后,文本框值将得到保存,
但是当我更新此值时,我得到了page.isvalid = false.

Hello All,

Please suggest,


Here I have used regularExpressionValidator for validating testbox value,
After Adding value and then Save ,textbox value get save,
but when i update this value ,then i got page.isvalid=false.

<asp:RegularExpressionValidator ID="RegtxtEstimatedCurrentValue" runat="server" ControlToValidate="txtEstimatedCurrentValue"Display="none" ErrorMessage="Please enter valid amount." ValidationExpression="([0-9]*(\.[0-9]+)?)|([0-9]+)"ValidationGroup="valgrpPropertyVal"></asp:RegularExpressionValidator>
                                                                           <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender16" runat="server" TargetControlID="RegtxtEstimatedCurrentValue"                      WarningIconImageUrl="../Images/Error.png" Enabled="True">
                                                                           </cc1:ValidatorCalloutExtender>




代码隐藏-----

btncave_click()
{
if(this.isvalid == true)
{
保存数据---
}
}



请告诉我解决方案




codebehind-----

btncave_click()
{
if(this.isvalid == true)
{
save data---
}
}



Please tell me the solution

推荐答案

新值首先有效吗?

您是否已在btncave_click()
中检查了文本框的内容 方法?检查页面生命周期,在这种情况下通常是罪魁祸首.
页面生命周期 [
Is the new value valid in the first place?

Have you checked the contents of your textbox in the btncave_click()
method? Check the page lifetime cycle, that''s often the culprit in such cases.
Page lifetime cycle[^]

Hope this helps.


这篇关于在文本框的编辑值之后,RegularExpressionValidator得到valid = false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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