Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上我想验证一个文本框是否是一周中的某一天。
是否任何数据注释都涵盖了这一点,或者这是我需要在其他地方的 for 循环下运行的东西。
如果是后者,我是在 model.designer.cs 中还是在控制器中携带它?
您可以使用正则表达式数据注释 + mvc 的内置验证。
http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.regularexpressionattribute.aspx#Y2063