1. What is ASP.NET MVC and why use it

This book assumes that you (or your boss) decided to use ASP.NET MVC knowing what it is. In case you do, you can safely ignore this chapter. But if you don’t, read this chapter before reading the book and you’ll be good to go.

1.1 What is it ?

In a nutshell, ASP.NET MVC is a technology used to create Web applications.

Web applications are used with a browser. Example of Web applications are Facebook, Google, and in fact most of the services you use. When you enter an http://something url in your browser, you get a Web application.

Simply put, ASP.NET MVC can be used to create a Web application like Facebook. Or a store, which is what we do in this book’s exercises.

1.2 Why use it ?

In case you know .NET and need to create a Web application, using ASP.NET makes sense since you can reuse your knowledge of the .NET Framework (or .NET Core) and language abilities (like C# and VB.NET).

There are several technologies inside of ASP.NET you may consider:

  • ASP.NET Web Forms: good for creating small and large Web applications when you know almost nothing to HTTP and HTML, but have experience developing client applications (for instance Windows Forms or WPF).
  • ASP.NET Web Pages: good for creating small Web applications without bothering with the structure.
  • ASP.NET MVC: good for creating large Web applications when you know HTTP and HTML.
  • ASP.NET Web API: good for creating REST APIs.

Though you can mix all of those technologies in a single ASP.NET Web application, choosing just one is a reasonable choice. Mixing several technologies would be done when you need to maintain for instance ASP.NET Web Forms but want to add new features using ASP.NET MVC.

1.3 Competing technologies

There are many technology stacks used to create Web applications. On a technological standpoint the following stacks would for instance allow to develop applications in a way similar to ASP.NET MVC :

  • Node.JS + Express
  • Ruby on Rails
  • Meteor

Selecting one technology or another can be debated for a while. It often boils down to beliefs or preferences, be there can be good reasons. For instance, if you know JavaScript and HTTP but nothing about .NET, you’ll probably get an easier time with Node.JS + Express than with ASP.NET MVC.