【发布时间】:2013-11-15 08:52:51
【问题描述】:
当我在 MVC3 中创建模型时,是否有任何解决方法可以在属性上设置自定义值,如以下示例 [MyCustomValue()] 以及以后如何以编程方式获取该值?
Imports System.ComponentModel
Imports System.ComponentModel.DataAnnotations
Imports System.Web.Mvc
Imports System.Collections.Generic
Public Class MyModel
Public Property MyModelId As Integer
<StringLength(20), MyCustomValue(True)>
Public Property Name As String
[...]
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-3 properties model data-annotations