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:
- Convert the .aspx pages from using CodeBehind to CodeFile.
- Place the Controllers folder into the App_Code.
- 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)
- 26 Oct 2022
- 07 Oct 2022
- 13 Sep 2022
- 06 Sep 2022
- 13 Aug 2022
Recent on Build5Nines.com
This site is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. We also participates in affiliate programs with Udemy, and other sites. This site is compensated for referring traffic and business to these companies.