您发现其中一个验证非常复杂,不适合任何一个验证器,您会怎么做? [英] You find that one of your validations is very complicated and does not fit in any of the validators, what will you do?

查看:102
本文介绍了您发现其中一个验证非常复杂,不适合任何一个验证器,您会怎么做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您发现其中一个验证非常复杂且不适合任何验证器,您将怎么做?

You find that one of your validations is very complicated and does not fit in any of the validators, what will you do?

推荐答案

验证器的验证?我很困惑...
Validation of the validator? I''m confused...


我假设您使用.Net作为您的语言.您可能需要阅读有关RegularExpressionValidator的更多信息.
此处 [
I assume you are using .Net as your language. You may want to read more about RegularExpressionValidator.
Here [^] is an overview of the ASP.Net validators.



  • 为此编写复杂的验证器.

  • Write the complex validator for it.

  • 将其嵌入到更通用(更简单)的验证规则中.当然,这意味着放弃了一些必需的约束,最终结果会降低精度,但是折衷方案是可以接受的.

  • Embed it into a more generic (simpler) validation rule. Of course that implies discarding some of the required constraints, you''ll end up with less precision but the trade-off might be acceptable.


这篇关于您发现其中一个验证非常复杂,不适合任何一个验证器,您会怎么做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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