| by Achyut Kendre | No comments

What is ASP.NET MVC 5?

ASP NET MVC 5

What is design Patterns?

Design patterns tells you how to write a code, design patterns provides you some set of guide lines, rules specifications if we follow them it will give us some advantage. Every design pattern has it’s own advantage. Few popular design patterns are –

  • MVC
  • MVP
  • MVVM
  • Repository and many more.

What is MVC?

MVC stands for Model View Controller Design Pattern, it is very popular design pattern using which you can develop the web applications. MVC forces you to implement SOC (Separation of Concern) while developing any web application. What soc say’s is find out the basic concerns of any thing and separate those concerns from each other so that load carrying capability of application is going to grow (i.e. your application can handle more number of users).

We can implement it every where in all types of programs but it is more use full only in web applications. If you consider any program weather it is addition of two numbers, some crm software, inventory software or any ERP software it will have three basic things in it –

  1. Data
  2. User Interface
  3. Logic

So what MVC says separate data, user interface and logic from each other so that data is managed by M part of MVC called Model, User interface will be managed by V part of MVC called View and logic will be managed by C part of MVC called Controller so that your application can carry more load or provide the service to more number of users.

Model View Controller

Model: Data is managed by M part of MVC called Model. Model is responsible for Data.

View: User Interface/Presentation is managed by V part of MVC called View.  View is responsible for UI/Presentation.

Controller: Controller is responsible for  logic /interaction in application.  Controller manages the logic of the application.

Few Frameworks who uses MVC Design Pattern –

  • ASP.NET core
  • Ruby on Rails
  • ASP.NET MVC 5
  • PHP Zend
  • Java Struts/ Spring Boot

What is ASP.NET?

ASP.NET is an open-source, server-side web-application development technology designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, applications and services. It is built over .NET Framework has all Features of .NET Framework”

ASPNEtTEchnologystack

ASP.NET MVC 5?

Web Technology built on top of ASP.NET which will help you to develop the cloud ready, modern web applications using MVC Design Pattern.
Developers can build dynamic web applications using ASP.NET MVC framework that enables a clean separation of concerns, fast development, and TDD friendly.

ASP.NET MVC 5 History

Version YearVisual StudioFramework Version
MVC 1.02009VS20083.5
MVC 2.02010VS 20083.5 & 4.0
MVC 3.02011VS 20104.0
MVC 4.02012VS 2010 SP1, VS 2012,
MVC 5.02013VS 20134.5

Why ASP.NET MVC 5?

On Following Constraints ASP.NET MVC is more better Choice –

  • Open Source
  • High Performing.
  • Support Test Driven Development (TDD)
  • Search Engine Friendly
  • Cloud Friendly
  • Mobile Friendly UI
  • Client Side Application Development
  • No Page Life Cycle In ASP.NET MVC.
  • UI Generated Using Helpers (Light Weight).
  • Third Party View Engines Supported.
  • Open Source Platform.
  • New View Engine Razor (Over ASPX)

High Performance:-
As compare web form the performance of ASP.NET MVC is high.

Request /Response Model ( no event driven programming, no view state etc.)
Size of request /response will be very small so web server need to process less data or manage less date so web server can handle more number of users.
ASP.NET Support Model View Controller design pattern it implements SOC which automatically increase load carrying capability of application (your application can handle more number of users).
UI is also very light weight which will be loaded very fast.

Test Driven Development: –
In classic application development, we first write code and then we test the code as per test case. A New approach is called test driven development in which first we create test cases and then write a code as per test case, if test case is success then we write next code or we refactor existing code called test driven development.
ASP. NET MVC 5 has built in support for test driven development, it also has built in unit testing framework using which we can automate test driven development.

SEO Friendly:-
Search Engine Optimization are set of techniques/rules/guide lines we follow while developing any website or web application, it will increase the chances that your website will be visible in search engines like google, bing, yahoo etc. SEO has two important things –

  1. Clean/Meaning Full URLS
  2. Clean / Simple HTML
    and both these rules are followed by ASP.NET MVC, ASP.NET MVC generate the meaning full URLS and clean /simple HTML.

Cloud Ready: –
ASP.NET MVC application structure and configurations are cloud compatible so that you can host and run ASP.NET MVC 5 Application in any cloud infrastructure like Microsoft Azure, AWS, Google Cloud etc.

Mobile Friendly: –
ASP.NET MVC has built in & Integrated Bootstrap, bootstrap makes your web application UI compatible to mobile devices.
ASP.NET MVC has small request/response size and light weight UI which makes application more faster to work on devices with small bandwidth like mobiles.

Client Side Application Development:-
ASP.NET MVC 5 has request/response model which makes easy for us to integrate any client application development framework like Angular, Knockout, Backbone and develop a client application.

Create ASP.NET MVC Application Step by Step as follows –

Step 1: Open visual studio 2019 and click on Create a new project on the bottom right.

ASP.NET MVC Step1

Step 2: Search ASP.NET Web Application in the above-provided textbox and click on the template and click on the Next button as shown below.

ASP.NET MVC Step2

Step 3: Provide the project name say MVCFirstProject and click on Create button.

ASP.NET MVC3

Step 4: Select the MVC template and click on the Create button, with this a new MVC project is created. It will have following directory structure –

Folder Structure

Step 5: – Run this application using F5 will get you following output.

output