Html.EditorFor additionalViewData

ViewData is a dictionary.

You can write ViewData["Title"], or you can loop through ViewData (which is a collection of KeyValuePairs) or ViewData.Keys.


You can nest your htmlAttributes object in view data:

<%= Html.EditorFor(model => model.PhoneNumber, new { htmlAttributes = new { Title = "SomeValue" } })

Then in your editor template:

<%= Html.TextBox("", Model.Value, ViewData["htmlAttributes"])%>