Home Videos Exercises MCQ Q&A Quiz E-Store Services Blog Sign in Appointment Payment

Introduction of ASP.NET MVC

ASP.NET is a .NET framework which follows MVC design pattern.

ASP.NET MVC is used for web development. ASP.NET MVC provides everything required to build a Web application using MVC design pattern.


Continue to ASP.NET MVC Introduction

ASP.NET MVC is a .NET framework which follows MVC design pattern.

ASP.NET MVC is used for web development. ASP.NET MVC provides everything required to build a Web application using MVC design pattern.

It was first released in 10 December 2007 version ASP.NET MVC
It was then released in 13 March 2009 version ASP.NET MVC 1.0
Stable released in 12 April 2022 with version 5.2.8

It was developed by Microsoft.


What is ASP.NET MVC?

ASP.NET MVC is a .NET framework which follows mvc design pattern. It is used to create web application.


What is MVC?

  • MVC is Model View controller
  • MVC is a design pattern
  • MVC is used by all the technologies like, Java, .NET, PHP, Angular etc.
  • MVC pattern is used for building web, mobile, desktop applications etc.

As per Microsoft official site

"ASP.NET" MVC gives you a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and that gives you full control over markup for enjoyable, agile development.


Create first MVC 5 Application

  • open visual studio
  • create new project
  • select web application
  • select empty and check mvc framework
  • click to ok

MVC application structure

  • App_Data: All the data which is required for read & write into application.
  • App_Start: Here you put all the configuration file. Example- Route configuration, bundle configuration etc
  • Content: It stores images, css etc. (other than scripts)
  • Controllers:Here you put all the controllers
  • Fonts: These are some custom fonts which are used by bootstrap.
  • Models: This folder has all the models.
  • Scripts: Here you put all the scripts of the application
  • Views: Here you put all the views(html code)
  • favicon.ico- facion file

What is controller?

  • One of the main pillar of MVC(C-controller)
  • .cs file
  • Inherited from controller
  • Resides in controllers folder
  • Has controller convention in name
  • controllers are. cs files which reside in controllers folder. Controllers are used to handle browser incomming http request, get data from models (if required)

Role of a controller?

  • work with user input( or browser request)
  • play on important role in flow of application by handling incomming request and provide data to corresponding view or to browser request.

What is a View?

  • one of main pillar of MVC (v-view)
  • cshtml file( c sharp+html)
  • UI of application
  • Support pure html
  • Everything which is visible to a user on browser is view.

What is a Model?

  • one of main pillar of MVC(M-model)
  • .cs file
  • Model is responsible for data
  • In dynamic website data comes from database, then controller action method returns model to view.