Microsoft Most Valuable Professional

Chris Pietschmann

An MVP From Wisconsin



How To Use ASP.NET MVC in Website rather than Web Application Project

I recently started getting to know the ASP.NET MVC Framework (more specifically the Preview 4 release). The first thing I noticed upon installation is that it only comes with a Web Application Project Template. There is no regular ASP.NET Website template. So, I decided to try converting the Web Application Project Template to a regular ASP.NET Website. I actually prefer to use Website projects instead of Web Application projects since it gives a little more flexibility to deploy changes to the website after the website is already live. Plus, you can still throw anything you want into a DLL that goes into the Bin if you want.

I only needed to make a couple small changes when copying over the code into a new ASP.NET Website:

  1. Convert the .aspx pages from using CodeBehind to CodeFile.
  2. Place the Controllers folder into the App_Code.
  3. Change the Global.asax to be ASP.NET Website friendly (aka Not compile into DLL like in Web Application Project)

That's pretty much it, now I have a nice ASP.NET MVC Website template that I can use. To the right is an image of the file layout of the new ASP.NET MVC Website project.

The ASP.NET MVC release I used for this was the ASP.NET MVC Preview 4 release available on CodePlex.

Also, here's a link to download the code: ASP.NET MVC_Preview4_Website Project.zip (192.03 kb)

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,
Categories: asp.net | ASP.NET MVC
Posted by crpietschmann on Friday, August 15, 2008 4:15 PM
Permalink | Comments (2) | Post RSSRSS comment feed

Related posts

Comments

AdamC gb

Saturday, August 16, 2008 4:02 AM

AdamC

GREAT! Many thanks!

Niran in

Saturday, August 16, 2008 1:57 PM

Niran

Wonderful! Just what I wanted.

Comments are closed

About the author

I'm Chris Pietschmann, go to the About Me page to learn more about me.

Search

Sponsors

Web.Maps.VE - ASP.NET AJAX Virtual Earth Mapping Server Control

Recent comments

Disclaimer


This work is licensed under a Creative Commons Attribution 3.0 United States License, unless explicitly stated otherwise within the posted content.
© Copyright 2004 - 2008 Chris Pietschmann