BT

A Design Template Gallery Precedes ASP.NET MVC RC

| by Abel Avram Follow 12 Followers on Dec 23, 2008. Estimated reading time: 2 minutes |

A design template gallery has recently being made public for ASP.NET MVC users containing free web site views ready to be downloaded and incorporated into a site. ASP.NET MVC Release Candidate will ship in January containing a series of improvements like: No code-behind files by default, scaffolding support, MSBuild task for views.

The design template gallery contains views for ASP.NET MVC web sites. Templates are made up of a CSS stylesheet, images, View Master Pages, View User Controls, JavaScript code. The gallery is open sourced, each template being released to the gallery under the Creative Commons Attribution 3.0 license. Anybody can contribute to the gallery and can vote for the templates.

According to Scott Guthrie, VP in the Microsoft Developer Division, ASP.NET MVC will present a series of improvements in the soon to come release candidate:

Views won’t contain code-behind files by default

Based on feedback from a lot of people, we've decided to make a change so that MVC view files by default do not have code-behind files. This change helps to reinforce the purpose of views in a MVC world (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.

Views will have a top-level model property

Product Name: <%= Model.ProductName %>

HTML/AJAX helpers enable expression syntax

One of the requests a few people have asked for is the ability to use strongly-typed expression syntax (instead of using strings) when referring to the Model when using a View's HTML and AJAX helper objects.

Scaffolding support

The ASP.NET MVC RC build includes automatic "UI scaffolding" support when creating views using the new ASP.NET MVC "Add View" command inside Visual Studio.  The scaffolding support enables the automatic generation of views against any .NET type or object - meaning it can work against POCO classes, LINQ to SQL, LINQ to Entities, NHibernate, SubSonic, LLBLGen Pro, or any other object model. The scaffolding engine uses reflection to retrieve the public shape of a View's model type, and then passes it to a scaffolding template to populate appropriate markup based on it within the view being created.

MSBuild task for compiling views

By default when you do a build on an ASP.NET MVC project it compiles all code within the project, except for the code within view files.  With the ASP.NET MVC Beta you had to roll your own MSBuild task if you wanted to compile the views.  The ASP.NET MVC RC build now includes a built-in MSBuild task that you can use to include views as part of the project compilation process.  This will verify the syntax and code included inline within all views and master pages for the application, and give you build errors if it encounters any problems.

ASP.NET MVC RC will be released in January 2009.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss
BT