Html5 data- *与asp.net mvc TextboxFor html属性
如何使用TextboxFor添加data-* html属性? 
这是我现在有:
 @Html.TextBoxFor(model => model.Country.CountryName, new { data-url= Url.Action("CountryContains", "Geo") }) 
 正如你所看到的,在这里导致data-url的问题。 这是怎么回事? 
 你可以使用下划线( _ ),帮手是足够聪明的做剩下的事情: 
 @Html.TextBoxFor( model => model.Country.CountryName, new { data_url = Url.Action("CountryContains", "Geo") } ) 
对于那些想在ASP.NET MVC 3版本中实现相同的人,他们可以:
 <%= Html.TextBoxFor( model => model.Country.CountryName, new Dictionary<string, object> { { "data-url", Url.Action("CountryContains", "Geo") } } ) %> 
- ASP.NET MVC – HTTP身份validation提示
- 在MVC中,如何返回string结果?
- Visual Studio 2015支持MVC的旧版本吗?
- 我应该如何检查用户是否在MVC5中进行身份validation?
- 具有键“XXX”的ViewData项的types为“System.Int32”,但必须为“IEnumerable <SelectListItem>”types
- System.Runtime.Serialization.Json命名空间在哪里?
- MVC 4或5的MEF – 可插拔架构(2014)
- 什么是MVC中的ViewModel?
- MVC3 Valums Ajaxfile upload