Upload
gloria-kory-jenkins
View
221
Download
0
Tags:
Embed Size (px)
Citation preview
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
5. How to Install MVC?
6. MVC Release History
7. Creating First Asp.Net MVC Application
What is MVC?
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.
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
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:
ASP.NET supports three different development models
Differences between these development models are:
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).
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.
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.
How to Install MVC? (Continue…)
MVC Release History
How to Download MVC 3 & MVC 4?
EX
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.
Creating First Asp.Net MVC Application
Step-1• If you choose .NET Framework 3.5 you are not able to see MVC 3 & 4 option in new
Project Box.
Step-2• If you choose .NET Framework 4.0 Then
Step-3• If you choose .NET Framework 4.0 Then
Step-4
Step-5
Step-6
Step-7
Step-8
Step-9
Advantage of MVC over Asp.Net WebForms in details ?
MVC vs. WebForms
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
MVC vs. WebForms
MVC vs. WebForms• In MVC direct hit come to action(method you want to be run)
Example
Continue…Namespace
Assembly & Controller used in mvc application
Running First MVC Application
How to determine what version of mvc is being used by an existing mvc web application ?
MVC Version info in existing Application
There are two ways :
1. At design time
2. At runtime
Asp.net mvc namespace:
Version Info:
At runtime
Compare Asp.Net MVC & Web Application
1. Asp.Net MVC Application:
2. Web Application:
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.
Web Form URL
http://localhost:1928/WebForm1.aspx
Server
In WebForm’s URL are mapped to physical Files.
How to deploy application on IIS
1. Open IIS(start->run->type inetmgr)
How to deploy application on IIS
2. Deploy application on IIS.
How to deploy application on IIS2. Deploy application on IIS.
Summary!!