![Page 1: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/1.jpg)
Tutorial -01
![Page 2: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/2.jpg)
Objective
In this session we will discuss about :
1. What is MVC?
2. Why MVC?
3. Advantages of MVC over ASP.NET
4. ASP.NET development models
5. How to Install MVC?
6. MVC Release History
7. Creating First Asp.Net MVC Application
![Page 3: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/3.jpg)
What is MVC?
![Page 4: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/4.jpg)
MVC ?• MVC is successor of ASP.NET So Before going to discuss about MVC lets little bit talk about
Asp.Net.
• It is a part of .NET framework developed by Microsoft.
• It is used to Create Web Application(Internet Application).So that every one can access
this application from anywhere.
• This application will be access thru Web Browser( Firefox, Chrome. Internet Explorer etc)
by passing URL in url bar.
• This application will be stored & execute on server.
Like: www.google.com , www.prognoztech.com , www.amazon.com are internet
application we are accessing thru url.
![Page 5: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/5.jpg)
MVC (Continue…)
• There are a lot of other programming language( a language that machine
understand) used to create Internet application,
1. Java
2. PHP
3. CGI
4. ASP
![Page 6: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/6.jpg)
Disadvantage of ASP.NET
• There are a lot of code required to create Web(Internet) Application using ASP.NET,
• MVC make it simple by categorize the structure of Asp.Net in 3 parts.
• Lets talk about ASP.NET internet development model in details:
![Page 7: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/7.jpg)
ASP.NET supports three different development models
![Page 8: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/8.jpg)
Differences between these development models are:
![Page 9: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/9.jpg)
MVC Programming Model• MVC is one of three ASP.NET programming models.
• MVC is a framework for building web applications using a MVC (Model View
Controller) design:
1) The Model represents the application core (for instance a list of database records).
2) The View displays the data (the database records).
3) The Controller handles the input (to the database records).
![Page 10: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/10.jpg)
Why MVC?
• ASP.NET MVC helps to reduce the complexity of the web application by dividing an
application into three layers, Model, View and Controller.
• This separation (loose coupling) helps in some long term benefits like isolation of
components while development and also this separation provides better support for
test-driven development (TDD).
• ASP.NET MVC web site are good in performance and also easy to maintain.
![Page 11: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/11.jpg)
How to Install MVC?
• Before going to install mvc first check what version of MVC already installed in Your
computer.
• To check what MVC version already installed in My Machine open control panel then
open add or remove programs dialogue box.
![Page 12: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/12.jpg)
How to Install MVC? (Continue…)
![Page 13: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/13.jpg)
MVC Release History
![Page 14: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/14.jpg)
How to Download MVC 3 & MVC 4?
![Page 15: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/15.jpg)
EX
![Page 16: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/16.jpg)
Introduction of ASP.NET MVC 4• ASP.NET MVC 4 is a framework for building scalable, standards-based web
applications using well-established design patterns and the power of ASP.NET and
the .NET Framework.
• Currently ASP.NET MVC 4 is supported in Visual Studio 2010 and Visual Studio 2012,
previous versions of Visual Studio does not support ASP.NET MVC 4 as of now.
• If you don’t have ASP.NET MVC 4 in your box then install MVC 4 for Visual Studio
2010 or else use Visual Studio 2012 to get started with this.
![Page 17: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/17.jpg)
Creating First Asp.Net MVC Application
![Page 18: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/18.jpg)
Step-1• If you choose .NET Framework 3.5 you are not able to see MVC 3 & 4 option in new
Project Box.
![Page 19: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/19.jpg)
Step-2• If you choose .NET Framework 4.0 Then
![Page 20: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/20.jpg)
Step-3• If you choose .NET Framework 4.0 Then
![Page 21: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/21.jpg)
Step-4
![Page 22: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/22.jpg)
Step-5
![Page 23: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/23.jpg)
Step-6
![Page 24: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/24.jpg)
Step-7
![Page 25: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/25.jpg)
Step-8
![Page 26: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/26.jpg)
Step-9
![Page 27: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/27.jpg)
Advantage of MVC over Asp.Net WebForms in details ?
![Page 28: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/28.jpg)
MVC vs. WebForms
![Page 29: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/29.jpg)
MVC vs. WebForms• In WebForms whenever I want to execute any event say Button_Click() before that
page life cycle will execute first (you like or not doesn’t keep matter).
Page Life Cycle execute FirstThen event
![Page 30: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/30.jpg)
MVC vs. WebForms
![Page 31: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/31.jpg)
MVC vs. WebForms• In MVC direct hit come to action(method you want to be run)
![Page 32: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/32.jpg)
Example
![Page 33: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/33.jpg)
Continue…Namespace
![Page 34: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/34.jpg)
Assembly & Controller used in mvc application
![Page 35: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/35.jpg)
Running First MVC Application
![Page 36: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/36.jpg)
How to determine what version of mvc is being used by an existing mvc web application ?
![Page 37: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/37.jpg)
MVC Version info in existing Application
There are two ways :
1. At design time
2. At runtime
Asp.net mvc namespace:
![Page 38: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/38.jpg)
Version Info:
![Page 39: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/39.jpg)
At runtime
![Page 40: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/40.jpg)
Compare Asp.Net MVC & Web Application
1. Asp.Net MVC Application:
2. Web Application:
![Page 41: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/41.jpg)
MVC URL
http://localhost:1927/Home/Index
Server
Functions in Controller are generally called as Controller Action Methods.
In MVC’s URL are mapped to Controller Action Methods.
![Page 42: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/42.jpg)
Web Form URL
http://localhost:1928/WebForm1.aspx
Server
In WebForm’s URL are mapped to physical Files.
![Page 43: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/43.jpg)
How to deploy application on IIS
1. Open IIS(start->run->type inetmgr)
![Page 44: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/44.jpg)
How to deploy application on IIS
2. Deploy application on IIS.
![Page 45: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/45.jpg)
How to deploy application on IIS2. Deploy application on IIS.
![Page 46: Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models](https://reader037.vdocuments.site/reader037/viewer/2022110208/56649dab5503460f94a9a393/html5/thumbnails/46.jpg)
Summary!!