asp.net 更新面板和验证器不工作
我创建了 UserControl,其中包含一个文本框和该文本框的限制长度验证器。
我通过 UpdatePanel 动态地将用户控件添加到我的父 WebForm 中。问题是验证器无法工作。它只是不会触发。
我在 .net 3.5 上工作。
有谁知道发生了什么以及我怎样才能使这个验证器工作。
I have created UserControl that contains a textbox and a restricted length validator for that textbox.
I'm adding user controls dynamically via UpdatePanel to my Parent WebForm. And the problem is that Validator just won't work. It just won't trigger.
I work on .net 3.5.
Does anyone have any clue what is happening and how can I make this validator work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在详细信息视图中遇到类似的问题 - > updatepanel - >验证器
检查 此线程了解详细信息
在客户端单击我已使用 javascript 函数启用验证器
I have face similar problem and my validator in the detailsview-->updatepanel-->Validator
Check this thread for details
On the Client Click I have enable validator using javascript function
我也遇到过这样的问题。我使用的是.Net 3.0 和 VS2005。我参考了这个问题讨论和解决方案< /a> 可以解决我的问题。您也可以参考相同的内容。
I too faced such an issue. I was using .Net 3.0 and VS2005. I referred to this problem discussion and the solution and could solve my issue. You too can refer the same.
据我了解,您无法动态添加控件,因为这会改变页面结构并且 .net 会变得混乱。相反,您必须让所有控件加载“onLoad”,然后只需更改其可见标志即可根据需要显示或隐藏它们。
这样 .net 就可以跟踪它们并且很高兴。
As far as I understand it you can't add controls dynamically as this changes the page structure and .net gets confused. Instead you have to have all controls loaded "onLoad" and then simply change their visible flag to show or hide them as needed.
This way .net can keep track of them all and is happy.