Search code examples
asp.net-mvcasp.net-mvc-3scaffoldingscaffold

MVC3 - Scaffold Template (Field Order)


When using the following dialog to add a view, is there anyway you can state in what order you want the fields created?

enter image description here

I tried [Column(Order=0)] ::: [Column(Order=12)], but no joy!

Thanks Paul


Solution

  • This is happening because the Details.tt template (as well as all the others) does not do any ordering when generating the markup. More details on how to customize the templates: ASP.NET MVC custom T4 templates for views