Passing data attribute to TextBoxFor not working
- by john G
I have the following code inside my ASP.NET MVC 4 razor view:
<div>
<span class="f">Old Tag</span>
@Html.TextBoxFor(model => model.olfTag, new { data_autocomplete_source = Url.Action("AutoComplete", "Home") })
@Html.ValidationMessageFor(model => model.olfTag)
</div>
But data_autocomplete_source with TextBoxFor will not work. Can anyone give me some advice?