您可以提供有关requiredFieldValidator的帮助吗? [英] can you help regarding requiredFieldValidator ?

查看:61
本文介绍了您可以提供有关requiredFieldValidator的帮助吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是我正在使用包含文本框的updatepanel,该文本框具有RequiredFieldValidator和一个用于关闭updatePanel的关闭按钮

My problem is i m using updatepanel which contains Textbox which has a RequiredFieldValidator and a close button which closes the updatePanel 

问题是,当我尝试使用关闭按钮关闭updatePanel时,屏幕上将显示requiredFieldvalidator,并且未调用关闭按钮事件并且关闭按钮实现未完成

the problem is when i try to close the updatePanel using close button the requiredFieldvalidator comes up on the screen and the close button event is not called and close button implementation is not done 

        protected void close_Click(object sender, EventArgs e)
        {
            UpdatePanel2.Visible = false;
        }

 

我想要实现的是,通过按关闭按钮,更新面板应该不可见,这似乎很简单,但是这个RFValidator让我发疯了

 

what I want to achieve , is by pressing close button , update panel should go invisible seems simple but this RFValidator is driving me nuts

你能帮忙吗?


推荐答案

轻松.

mybutton.CausesValidation = false;

<asp:Button ID="mybutton" Text="Submit" CausesValidation="False" OnClick="mybutton_Click" runat="server"/>


这篇关于您可以提供有关requiredFieldValidator的帮助吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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