ASP.NET, Coding

How to Get Started with ASP.NET MVC 4

What is ASP.NET MVC?

MVC design pattern is an architectural pattern that divides the application into three components, Model, View and Controller.

Models: the components used to implement the logic for your application domain, often they used to retrieve or save data from/to the database depending on the user inputs.

Views: used to accept user inputs and pass them to the controller and view the results.

Controllers: handle user request and responds to user inputs and interactions by selecting a view to render that displays UI.

asp.net mvc pattern

ASP.NET MVC is the Microsoft MVC implementation for building web applications. ASP.NET MVC is part of Microsoft asp.net framework.

mvc architecture

ASP.NET MVC is not a replacement for asp.net web forms but it’s another framework for building web applications. So which one should I use to build my web application? Well, it depends on application business requirements. So you should choose the framework that makes it easy and fast for your team to implement the requirements. Before you decide to which framework to use, look at the comparison between the two frameworks.

Advantages of MVC Model

  • Enable clean separation of concerns (SoC).
  • Enable full control over the rendered HTML.
  • Enable Test Driven Development (TDD) (built with TDD in mind).
  • SEO and REST friendly URL.
  • Easy integration with JavaScript frameworks.
  • Support third-party view engines such as NVelocity, Brail, NHaml.
  • No ViewState and PostBack events.
  • Follows the stateless nature of web.
  • Extensible and Pluggable framework.
  • Ideal platform for Web 2.0 applications.

Advantages of Web Form Model

  • Provides RAD development.
  • Easy development model for heavy data-driven LOB applications.
  • Provides rich controls.
  • Familiar model for windows form developers

Installing ASP.NET MVC
You can easily install ASP.NET MVC using any one of the following options:

  1. Installing via Web Platform Installer
  2. Installing via the installer executable
  3. Installing via NuGet(learn more)

Create your first ASP.NET MVC 4 application:

1. Choose the project type ASP.NET MVC 4 Web Application

2. Choose Internet Application project template.

3. View the solution explorer so you can see the structure of the project with the main components (folders) Controllers, Models, and Views.

4. Build and Run.

This is the default template for ASP.NET MVC application. The next article will be about writing your first application using ASP.NET MVC 4.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.