How to create a simple website in ASP.NET MVC
Part one of a seven-part series of blogs

This blog explains the steps you'll need to follow to create a simple one page website in ASP.NET MVC. The aim of the blog is not to act as a tutorial, but to help people choose between ASP.NET MVC and classic ASP.NET.

  1. An overview of creating a website in ASP.NET MVC (this blog)
  2. Creating an ASP.NET MVC website
  3. Creating an entity model in MVC
  4. Creating a view model
  5. Ensuring MVC shows the right page - router and controller
  6. Creating our view
  7. Conclusion

Posted by Andy Brown on 16 June 2014

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

An overview of creating a website in ASP.NET MVC

The aim of this blog isn't to be a full tutorial in MVC (that might follow in the fullness of time); rather it's to explain what the process of creating an ASP.NET MVC website involves.

This blog should be especially useful for classic ASP.NET developers wondering whether to learn the Model-View-Controller (MVC) approach to website development.

Our example

The aim of this blog will be nothing if not modest: we'll aim to take a table of films (Americans - read "movies") in SQL Server ...

SQL Server table of films

The table of films we want to show in a web page.

... and display it on a webpage:

The list of films

What the final webpage should look like.


The steps needed to accomplish this

This blog will show the steps needed to create this ASP.NET MVC website:

Stage Notes
Create the website I'll be showing how to do this using Visual Studio 2012 and C# (you'd be foolish to use VB).
Create an entity model This will explain about your choices for accessing data using classes, and how to create an entity model.
Create a view model How to create a class upon which our view will be based (including writing the LINQ needed to get at the data).
Set the router, and create the controller Make sure that we can get to the web "page" containing our list of films.
Create the view Finally, create the view showing the list of films, and display it in our browser.
Conclusion A summing-up of what we've discovered along the way!

I won't be explaining much about the C# code used along the way; my aim is to give an impression of how MVC works, and how it is completely different to classic ASP.NET webforms.

Let's start with creating the website!

This blog has 0 threads Add post