You could use underscore (_
) and the helper is intelligent enough to do the rest:
@Html.TextBoxFor(
model => model.Country.CountryName,
new { data_url = Url.Action("CountryContains", "Geo") }
)
And for those who want to achieve the same in pre ASP.NET MVC 3 versions they could:
<%= Html.TextBoxFor(
model => model.Country.CountryName,
new Dictionary<string, object> {
{ "data-url", Url.Action("CountryContains", "Geo") }
}
) %>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…