Tab Order in ASP.NET MVC 3 Helpers

Abdullah Saqib picture Abdullah Saqib · Jul 13, 2011 · Viewed 24.3k times · Source

How can I use Tab Order property for following code:

<td>
    @Html.EditorFor(model => model.Cost)                
</td>

I tried this:

<td tabindex=1>
    @Html.EditorFor(model => model.Cost)                
</td>

any suggestions?

Answer

Joey Green picture Joey Green · Sep 29, 2011

You can also specify the same html attribute in the helper itself as follows.

@Html.TextBoxFor(model => model.Cost, new { tabindex = 1 })