验证动态创建的控件 [英] Validate Dynamically created Controls
问题描述
嗨
我从数据库创建了动态控件,例如Textbox,DropDown list.假设我有电话号码"和电子邮件"之类的文本框.现在我想动态验证这些控件.我该怎么做.请给我一个解决方案.
在此先感谢
Hi
I created dynamic controls from DB like Textbox,DropDown list . Suppose i have Textbox like Phone No and Email . now I want to Validate these controls Dynamically . How can i perform it . Kindly suggest me a solution .
Thanks in advance
推荐答案
现在我要验证这些控件动态
now I want to Validate these controls Dynamically
动态是指人们何时向其中输入正确的内容?
您既可以在运行时将验证控件与文本框/下拉框一起添加,也可以将验证控件从前保留在页面上,然后将它们与动态控件绑定在一起.
您还可以将Javascript绑定到在运行时创建的控件.
By dynamically you mean when people enter something into it right?
Either you can add validation controls at runtime along with textbox/dropdwon box or keep validation controls on the page from before and just tie them up with your dynamic controls.
You can also tie up Javascripts to the controls created at runtime.
您可以在运行时创建比较/必需的验证器,并将其与适当的控件绑定.
这将帮助您在运行时验证任何动态创建的控件. :thumbsup:
You can create compare/required validator at runtime and bind it with appropriate control.
This will help you to validate any dynamically crated control at runtime. :thumbsup:
这篇关于验证动态创建的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!