The names of the files and folders under the \Views
application sub-folder will now automatically be updated when you perform
controller class rename or action method rename using the “Rename” refactoring
command in VS 2008. VS 2008 will apply the standard convention-based
naming pattern to existing view files/folders when the Controller class is
updated.
View Improvements
The RC build includes a number of view-specific enhancements
that were incorporated based on feedback during the preview releases.
Views without Code-Behind Files
Based on feedback we’ve changed view-templates to not have a
code-behind file by default. This change helps reinforce the purpose of
views in a MVC application (which are intended to be purely about rendering and
to not contain any non-rendering related code), and for most people eliminates
unused files in the project.
The RC build now adds C# and VB syntax support for
inheriting view templates from base classes that use generics. For
example, below we are using this with the Edit.aspx view template – whose
“inherits” attribute derives from the ViewPage<Product> type:
Figure 22
One nice benefit of not using a code-behind
file is that you'll now get immediate intellisense within view template files
when you add them to the project. With previous builds you had to do a
build/compile immediately after creating a view in order to get code
intellisense within it. The RC makes the workflow of adding and
immediately editing a view compile-free and much more seamless.
Important: If you are upgrading a ASP.NET MVC
project that was created with an earlier build make sure to follow the steps in
the release notes – the web.config file under the \Views directory needs to be
updated with some settings in order for the above generics based syntax to
work.