对面的[对比(QUOT;")数据在.net中的注释? [英] Opposite of [compare(" ")] data annotation in .net?

查看:133
本文介绍了对面的[对比(QUOT;")数据在.net中的注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是相反/否定在ASP.NET [比较()] 数据标注?

即:两个属性必须持有不同的价值观

 公共字符串用户名{获得;组; }[东西[用户名]]
公共字符串密码{搞定;组; }


解决方案

<一个href=\"http://www.devtrends.co.uk/blog/the-complete-guide-to-validation-in-asp.net-mvc-3-part-2\">http://www.devtrends.co.uk/blog/the-complete-guide-to-validation-in-asp.net-mvc-3-part-2

检查出来,你想要什么,我想。

What is the opposite/negate of [Compare(" ")] data annotation" in ASP.NET?

i.e: two properties must hold different values.

public string UserName { get; set; }

[Something["UserName"]]
public string Password { get; set; }

解决方案

http://www.devtrends.co.uk/blog/the-complete-guide-to-validation-in-asp.net-mvc-3-part-2

Check it out, exactly what you want, I think.

这篇关于对面的[对比(QUOT;&QUOT;)数据在.net中的注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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