0% found this document useful (0 votes)
14 views21 pages

First Lecture

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
14 views21 pages

First Lecture

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 21

In The Name of Allah

Outlines

 What is ASP.NET MVC?


 Model
 View
 Controller
 Basic Workflow of MVC
 Advantages of MVC
 Version History of MVC
 Directory Structure of MVC
What is ASP.NET MVC?

 MVC is an architectural pattern.


 It separates the application into three main components.
 The three components are Model, View, and Controller.
 It handles specific development aspects of an application.
 MVC is the most frequently used industry-standard web
development framework.
Model

 Model is a simple class.


 It is the shape of the data.
 The model contains business logic.
 Controller and View can access the model.
 The model helps to pass the data from the controller to view and view to
the controller.
 Using the model we are displaying data in the view page.
View

 The View is a user interface.


 It is used to display the entire data using the model.
 We are using two type of view engines in view.
 One is the traditional view engine and another one is the Razor view
engine.
 Traditional view engine is normal “.ASPX” page.
 Razor view engine is used to develop a normal page design using HTML
Helper controls.
 It contains “.CSHTML” extension.
 A syntax-wise little bit different in both view engines.
Controller

 The controller is the heart of MVC and it handles the user request.
 It is a simple class.
 The controller can access the model and pass data to view with the
help of a model.
 We can pass the data between the controller and view using
View Data, Temp Data, and View Bag.
 The controller is intermediate between model and view
Model ,View, Controller
Basic Workflow Of MVC
Advantages of MVC

 Separation Of Concern (SoC) is the main advantage. Here we are


separating Model, View, and Controller.
 We can easily maintain MVC application.
 Test Drive Development (TDD) is another main advantage. We can
create an application with a unit.
 We can write our own test case.
 Split the application and many developers can work at a time without
affecting each other.
 MVC application is a default responsive website and mobile template.
 We can create our own view engine.
Is MVC Replacing ASP.NET Web Forms?

 No, MVC is not replacing ASP.NET web forms.


 It is another choice for developers to use.
 Many companies are still using the traditional ASP.NET web form.
 MVC is now used by many companies and it is very famous.
 It's based on the customer opinion and project structure, whether they
use the traditional ASP.NET application or ASP.NET MVC.
Version History of MVC
 ASP.NET MVC 1
 Released on Mar 13, 2009
 Runs on .NET 3.5
 Visual Studio 2008

 ASP. NET MVC 2


 Released on Mar 10, 2010
 Runs on . NET 3.5, 4.0
 Visual Studio 2008 & 2010

 ASP. NET MVC 3


 Released on Jan 13, 2011
 Runs on . NET 4.0
 Visual Studio 2010

 ASP. NET MVC 4


 Released on Aug 15, 2012
 Runs on . NET 4.0, 4.5
 Visual Studio 2010 sp1 & 2012

 ASP. NET MVC 5


 Released on 17 October 2013
 Runs on . NET 4.5
 Visual Studio 2013
Directory Structure of ASP.NET MVC
App-Data - ASP.NET MVC Folder Structure

 App_Data folder can contain application data files like LocalDB, .mdf files,
xml files and other data related files.
 IIS will never serve files from App_Data folder.
App-Start-ASP.NET MVC Folder Structure

 App_Start folder can contain class files which will be executed


when the application starts.
 Typically, these would be config files like AuthConfig.cs,
BundleConfig.cs, FilterConfig.cs, RouteConfig.cs etc.
 MVC 5 includes BundleConfig.cs, FilterConfig.cs and
RouteConfig.cs by default.
Content -ASP.NET MVC Folder Structure

 Content folder contains static files like CSS files, images and icon files.
 MVC 5 application includes bootstrap.css, bootstrap.min.css and
Site.css by default.
Controller -ASP.NET MVC Folder Structure
 Controllers folder contains class files for the controllers.
 Controllers handles users' request and returns a response.
 MVC requires the name of all controller files to end with "Controller".
Fonts -ASP.NET MVC Folder Structure
 Fonts folder contains custom font files for your application.
Model -ASP.NET MVC Folder Structure
 Models folder contains model class files.
 Typically model class includes public properties, which will be used by
application to hold and manipulate application data.
Scripts -ASP.NET MVC Folder Structure
 Scripts folder contains JavaScript or VBScript files for the application.
 MVC 5 includes javascript files for bootstrap, jquery 1.10 and modernizer
by default.
THE END

You might also like