When I generate my controller and views with the below command
scaffold controller <Entity> -force -repository -DbContextType "XXX" -Area YYY
It generates .aspx (web form) pages instead of .cshtml (razor)
How can I change this default behaviour. I think when I first created a new project it asked me to select the default view engine and I picked the wrong one (webforms).
Also are there any free or cheap T4 templates for MVC 3 that generate nicer and more functional views. i.e using webgrid / jQUery etc.
Solution wide scaffolders configuration is stored in
scaffolding.configwhich is located in the same folder with solution file.On installation stage
MvcScaffoldingpackage launchesinit.psscript (you can find it in<packages folder>\MvcScaffolding.<version>\toolsdirectory). Script countsaspx,cshtmlandvbhtmlviews and based on these numbers decideds what view scaffolder will be used. Here is a piece of this logic:So you can switch view scaffolder using following commands:
Or you can manually edit
scaffolding.configfile and replace value forScaffolderNameattribute in tag: