Como contraste a la respuesta correcta de @ Stuy1974, si no quiere dejar la solución EditorFor
, vas a tener que cablear su propio Editor Template.
@ModelType SomeApp.ViewModels.SomeNiftyViewModel
// be sure to include the TabIndex info in the ViewModel
@Html.TextBoxFor(model => model.Cost, new { tabindex = model.TabIndex })
También puede utilizar el parámetro ViewData ya ha pasado a la plantilla editor directamente en lugar de añadir el índice de tabulación para el modelo:
// In the main view
@Html.EditorFor(model => model.Cost, new { TabIndex = 3 })
// In the editor template
@{ int tabIndex = (ViewData["TabIndex"] as int?) ?? 0; }
@Html.TextBoxFor(model => model, new { tabindex = tabIndex })
La última vez que SO ha visto @AbdullahSaqib fue 5 días después de que se hizo esta pregunta en 2011 –