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.
我正在使用带有 aspx 引擎的 mVC3,
<%html.TextBoxFor(m=m.Code,new {maxlength="6"})%>
我想从资源文件中获取 vlaue "6"
您可以定义一个全局资源文件(在您的App_GlobalResources文件夹中),然后使用强类型类来访问值:
App_GlobalResources
<%= html.TextBoxFor(m = m.Code, new { maxlength = MyResources.MaxLength }) %>