SlideShare a Scribd company logo
1 of 21
Gaurav Kumar Arora 
Twitter - #g_arora 
Gaurav is an enthusiast Technologist. He is an author of 
http://c-sharpcorner.com , having more than 13yrs experience in the industry
ASP.NET MVC – SERIES FOR 
BEGINERS: PART-1
ATTENTION 
This is a first session of our Beginners series. We will discuss very basic 
topics in this session. 
I would like to make this session more interactive, do participate 
and make this session more presentable. 
Compile your views, which you want to add and send me I will 
publish all with your name.
AGENDA 
 Introduction to MVC 
 Why MVC? 
 Reason to choose MVC against asp.net web forms 
 Overview of Model View Controller 
 Overview working of MVC 
 Overview of routes collection 
 Revisiting session 
 Question / Answer / Suggestion
INTRODUCTION TO MVC 
A background to Asp.Net MVC: 
 Is based on Asp.Net 
 A framework for RAD (rapid application development), used to 
develop Web application 
 Is a composition of Model, View Controller 
 Is an open source and code is available at CodePlex [In 2009 – 
released under Microsoft Public License and in 2012 – released 
under Apache License 2.0]
WHY MVC? 
Take a moment and think about a valuable Software Pattern 
Model-view-controller. We can also predicts from the image that 
MVC pattern divides a software application into a three 
interconnected parts/components. Basically, it’s a concept of 
separation (here just separation of internal representation of 
information from ways/logics/techniques how it is being 
represented to the end-user)
WHY MVC? 
Controller can send commands/directions to the model to update 
its state as well as commands over to view. 
Associated views and controller get notified by Model as per 
changes of its state. 
Model provides specific result as a output upon the request of View 
to represent.
WHY MVC? 
Lets understand this from associated image 
In simple words, we can say that MVC is 
providing a facility to make our layers 
separate which are separated and 
interacting with each-other.
ASP.NET MVC OVER ASP.NET WEBFORMS 
There are numerous reasons to choose Asp.Net for web 
development over Asp.Net WebForms: 
 Asp.Net MVC is a web framework and is based on MVC pattern 
 No viewstate (performance is better in asp.net mvc) 
 Completely testable 
 Integration with client side (easily handshake with client side 
scripting like Jquery etc.) 
 Flexibility (provides various views engines, which renders HTML – 
Razor View Engine is most famous)
OVERVIEW OF MODEL VIEW CONTROLLER 
Devs we have already covered this in previous slides, lets discuss it 
again.
OVERVIEW OF MODEL VIEW CONTROLLER 
Conclusion - what we discussed (for asp.net mvc framework) 
What is a Model? 
 MVC model is typically a class (of C# or VB.NET). 
 Both controller and view can access model. 
 A model can be used to pass data from Controller to view 
 Main purpose of a view is to display data in page with the use of 
model.
OVERVIEW OF MODEL VIEW CONTROLLER 
Conclusion - what we discussed (for asp.net mvc framework) 
What is a View? 
 View is nothing but a page you can say a web page and it is not 
having any code-behind 
 All page specific HTML generation and formatting can be done 
inside view 
 A request to view can be made only from a controller’s action 
method
OVERVIEW OF MODEL VIEW CONTROLLER 
Conclusion - what we discussed (for asp.net mvc framework) 
What is a Controller? 
 Controller is typically a class (of C# or VB.Net) and inherits 
"system.mvc.controller" 
 Within this class methods can be implemented and called as action 
methods. These are responsible for responding to browser and/or 
calling views. 
 Controller class can access and use model class to pass data to 
views
OVERVIEW WORKING OF MVC 
In this session we are not going to cover only basic things: 
High level overview says – browser sends request to Asp.Net MVC 
and it returns response back to browser [request is HTTP Request 
and response is HTTP response]. 
Lets discuss shown image:
OVERVIEW WORKING OF MVC 
In broader way – First request 
comes to Route Tables then 
passes to specific controller before 
interaction with Model Binding it 
goes through Authentication & 
Authorization and afterwards Fires 
a specific Action Method and 
execute the results to View. 
Lets take an example to discuss 
more.
OVERVIEW OF ROUTES COLLECTION 
In simple words, routes collection (also can say Route table) is 
nothing but a collection of different routes. 
What is route? 
A system works on pattern matching mechanism. A route 
match incoming request to meet a specific pattern and allows 
once matched else denied. 
What happened at runtime? 
At runtime, routing engine uses route table (contains different 
routes) to match incoming urls with the defined route patterns 
(url patterns).
OVERVIEW OF ROUTES COLLECTION 
In above image, url will be processed if any match found else 
it will throw the HTTP Status code Not Found (404 error).
REVISIT SESSION 
In this very first session we covered: 
 Basics of MVC 
 Discussed MVC pattern 
 Discussed basics of MVC architecture 
 Discussed basics of route collection / route table 
 Read here: ASP.Net MVC Series For Beginners: Part 1
QUESTION/ANSWER 
Surely, you should have questions, it is hard to discuss all the 
questions, please compile your questions and shoot me an email.
FEEDBACK 
This is a series of sessions, today we covered very basics of asp.net 
mvc part. 
In coming session we will cover new and some advanced topics. 
Your feedback is very important. Provide your feedback so, I can 
share more worthful things with you.
CONTINUES… 
Lets meet in next session …

More Related Content

What's hot

ASP.NET MVC Introduction
ASP.NET MVC IntroductionASP.NET MVC Introduction
ASP.NET MVC Introduction
Sumit Chhabra
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC
eldorina
 
Mvvm pattern
Mvvm patternMvvm pattern
Mvvm pattern
msarangam
 

What's hot (19)

ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
Difference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvcDifference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvc
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Head first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rttHead first asp.net mvc 2.0 rtt
Head first asp.net mvc 2.0 rtt
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1
 
What is MVC?
What is MVC?What is MVC?
What is MVC?
 
Introduction to mvc architecture
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
 
Difference between wcf and asp.net web api
Difference between wcf and asp.net web apiDifference between wcf and asp.net web api
Difference between wcf and asp.net web api
 
Mvc
MvcMvc
Mvc
 
Difference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvcDifference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvc
 
MSDN - ASP.NET MVC
MSDN - ASP.NET MVCMSDN - ASP.NET MVC
MSDN - ASP.NET MVC
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
ASP .net MVC
ASP .net MVCASP .net MVC
ASP .net MVC
 
ASP.NET MVC Introduction
ASP.NET MVC IntroductionASP.NET MVC Introduction
ASP.NET MVC Introduction
 
ASP .NET MVC
ASP .NET MVC ASP .NET MVC
ASP .NET MVC
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Mvvm pattern
Mvvm patternMvvm pattern
Mvvm pattern
 

Viewers also liked

Aspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_finalAspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_final
Credera
 

Viewers also liked (20)

Aspnet mvc
Aspnet mvcAspnet mvc
Aspnet mvc
 
Benefits of using angular js
Benefits of using angular jsBenefits of using angular js
Benefits of using angular js
 
Aspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_finalAspnet mvc vs_web_forms_final
Aspnet mvc vs_web_forms_final
 
AngularJS is awesome
AngularJS is awesomeAngularJS is awesome
AngularJS is awesome
 
Real time app with SignalR
Real time app with SignalR Real time app with SignalR
Real time app with SignalR
 
Asp Net (FT Preasen Revankar)
Asp Net   (FT  Preasen Revankar)Asp Net   (FT  Preasen Revankar)
Asp Net (FT Preasen Revankar)
 
Introduction To Google Android (Ft Rohan Bomle)
Introduction To Google Android (Ft Rohan Bomle)Introduction To Google Android (Ft Rohan Bomle)
Introduction To Google Android (Ft Rohan Bomle)
 
«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET
 
SignalR With ASP.Net part1
SignalR With ASP.Net part1SignalR With ASP.Net part1
SignalR With ASP.Net part1
 
Benefits of developing a Single Page Web Applications using AngularJS
Benefits of developing a Single Page Web Applications using AngularJSBenefits of developing a Single Page Web Applications using AngularJS
Benefits of developing a Single Page Web Applications using AngularJS
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
 
SignalR
SignalRSignalR
SignalR
 
SignalR
SignalRSignalR
SignalR
 
AngularJS performance & production tips
AngularJS performance & production tipsAngularJS performance & production tips
AngularJS performance & production tips
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
Introduction to AngularJS Framework
Introduction to AngularJS FrameworkIntroduction to AngularJS Framework
Introduction to AngularJS Framework
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
The Art of AngularJS in 2015
The Art of AngularJS in 2015The Art of AngularJS in 2015
The Art of AngularJS in 2015
 

Similar to ASPNet MVC series for beginers part 1

ASP.NET MVC From The Ground Up
ASP.NET MVC From The Ground UpASP.NET MVC From The Ground Up
ASP.NET MVC From The Ground Up
Kevin Griffin
 

Similar to ASPNet MVC series for beginers part 1 (20)

Mvc
MvcMvc
Mvc
 
Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9Asp.net c# MVC-5 Training-Day-1 of Day-9
Asp.net c# MVC-5 Training-Day-1 of Day-9
 
MVC - Introduction
MVC - IntroductionMVC - Introduction
MVC - Introduction
 
Asp.net Overview and Controllers
Asp.net Overview and ControllersAsp.net Overview and Controllers
Asp.net Overview and Controllers
 
Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0Introduction to ASP.NET MVC 1.0
Introduction to ASP.NET MVC 1.0
 
IntroductionToMVC
IntroductionToMVCIntroductionToMVC
IntroductionToMVC
 
ASP.NET MVC From The Ground Up
ASP.NET MVC From The Ground UpASP.NET MVC From The Ground Up
ASP.NET MVC From The Ground Up
 
Introdução ao ASP .NET MVC - C. Augusto Proiete
Introdução ao ASP .NET MVC - C. Augusto ProieteIntrodução ao ASP .NET MVC - C. Augusto Proiete
Introdução ao ASP .NET MVC - C. Augusto Proiete
 
Introdução ao ASP .NET MVC
Introdução ao ASP .NET MVCIntrodução ao ASP .NET MVC
Introdução ao ASP .NET MVC
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
MVC 6 Introduction
MVC 6 IntroductionMVC 6 Introduction
MVC 6 Introduction
 
MVC 4
MVC 4MVC 4
MVC 4
 
MVC & backbone.js
MVC & backbone.jsMVC & backbone.js
MVC & backbone.js
 
Ppt of Basic MVC Structure
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC Structure
 
MV(C, mvvm) in iOS and ReactiveCocoa
MV(C, mvvm) in iOS and ReactiveCocoaMV(C, mvvm) in iOS and ReactiveCocoa
MV(C, mvvm) in iOS and ReactiveCocoa
 
Jinal desai .net
Jinal desai .netJinal desai .net
Jinal desai .net
 
TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0TDD with ASP.NET MVC 1.0
TDD with ASP.NET MVC 1.0
 
Mvc interview questions – deep dive jinal desai
Mvc interview questions – deep dive   jinal desaiMvc interview questions – deep dive   jinal desai
Mvc interview questions – deep dive jinal desai
 
Principles of MVC for PHP Developers
Principles of MVC for PHP DevelopersPrinciples of MVC for PHP Developers
Principles of MVC for PHP Developers
 
MVC Framework
MVC FrameworkMVC Framework
MVC Framework
 

More from Gaurav Arora (6)

Test driven development
Test driven developmentTest driven development
Test driven development
 
ASP NET MVC Series For Beginers Part 2
ASP NET MVC Series For Beginers Part 2ASP NET MVC Series For Beginers Part 2
ASP NET MVC Series For Beginers Part 2
 
Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1
 
Unit Testing Using N Unit
Unit Testing Using N UnitUnit Testing Using N Unit
Unit Testing Using N Unit
 
Silverlight Demos For Beginners
Silverlight Demos For BeginnersSilverlight Demos For Beginners
Silverlight Demos For Beginners
 
Wcf Transaction Handling
Wcf Transaction HandlingWcf Transaction Handling
Wcf Transaction Handling
 

ASPNet MVC series for beginers part 1

  • 1. Gaurav Kumar Arora Twitter - #g_arora Gaurav is an enthusiast Technologist. He is an author of http://c-sharpcorner.com , having more than 13yrs experience in the industry
  • 2. ASP.NET MVC – SERIES FOR BEGINERS: PART-1
  • 3. ATTENTION This is a first session of our Beginners series. We will discuss very basic topics in this session. I would like to make this session more interactive, do participate and make this session more presentable. Compile your views, which you want to add and send me I will publish all with your name.
  • 4. AGENDA  Introduction to MVC  Why MVC?  Reason to choose MVC against asp.net web forms  Overview of Model View Controller  Overview working of MVC  Overview of routes collection  Revisiting session  Question / Answer / Suggestion
  • 5. INTRODUCTION TO MVC A background to Asp.Net MVC:  Is based on Asp.Net  A framework for RAD (rapid application development), used to develop Web application  Is a composition of Model, View Controller  Is an open source and code is available at CodePlex [In 2009 – released under Microsoft Public License and in 2012 – released under Apache License 2.0]
  • 6. WHY MVC? Take a moment and think about a valuable Software Pattern Model-view-controller. We can also predicts from the image that MVC pattern divides a software application into a three interconnected parts/components. Basically, it’s a concept of separation (here just separation of internal representation of information from ways/logics/techniques how it is being represented to the end-user)
  • 7. WHY MVC? Controller can send commands/directions to the model to update its state as well as commands over to view. Associated views and controller get notified by Model as per changes of its state. Model provides specific result as a output upon the request of View to represent.
  • 8. WHY MVC? Lets understand this from associated image In simple words, we can say that MVC is providing a facility to make our layers separate which are separated and interacting with each-other.
  • 9. ASP.NET MVC OVER ASP.NET WEBFORMS There are numerous reasons to choose Asp.Net for web development over Asp.Net WebForms:  Asp.Net MVC is a web framework and is based on MVC pattern  No viewstate (performance is better in asp.net mvc)  Completely testable  Integration with client side (easily handshake with client side scripting like Jquery etc.)  Flexibility (provides various views engines, which renders HTML – Razor View Engine is most famous)
  • 10. OVERVIEW OF MODEL VIEW CONTROLLER Devs we have already covered this in previous slides, lets discuss it again.
  • 11. OVERVIEW OF MODEL VIEW CONTROLLER Conclusion - what we discussed (for asp.net mvc framework) What is a Model?  MVC model is typically a class (of C# or VB.NET).  Both controller and view can access model.  A model can be used to pass data from Controller to view  Main purpose of a view is to display data in page with the use of model.
  • 12. OVERVIEW OF MODEL VIEW CONTROLLER Conclusion - what we discussed (for asp.net mvc framework) What is a View?  View is nothing but a page you can say a web page and it is not having any code-behind  All page specific HTML generation and formatting can be done inside view  A request to view can be made only from a controller’s action method
  • 13. OVERVIEW OF MODEL VIEW CONTROLLER Conclusion - what we discussed (for asp.net mvc framework) What is a Controller?  Controller is typically a class (of C# or VB.Net) and inherits "system.mvc.controller"  Within this class methods can be implemented and called as action methods. These are responsible for responding to browser and/or calling views.  Controller class can access and use model class to pass data to views
  • 14. OVERVIEW WORKING OF MVC In this session we are not going to cover only basic things: High level overview says – browser sends request to Asp.Net MVC and it returns response back to browser [request is HTTP Request and response is HTTP response]. Lets discuss shown image:
  • 15. OVERVIEW WORKING OF MVC In broader way – First request comes to Route Tables then passes to specific controller before interaction with Model Binding it goes through Authentication & Authorization and afterwards Fires a specific Action Method and execute the results to View. Lets take an example to discuss more.
  • 16. OVERVIEW OF ROUTES COLLECTION In simple words, routes collection (also can say Route table) is nothing but a collection of different routes. What is route? A system works on pattern matching mechanism. A route match incoming request to meet a specific pattern and allows once matched else denied. What happened at runtime? At runtime, routing engine uses route table (contains different routes) to match incoming urls with the defined route patterns (url patterns).
  • 17. OVERVIEW OF ROUTES COLLECTION In above image, url will be processed if any match found else it will throw the HTTP Status code Not Found (404 error).
  • 18. REVISIT SESSION In this very first session we covered:  Basics of MVC  Discussed MVC pattern  Discussed basics of MVC architecture  Discussed basics of route collection / route table  Read here: ASP.Net MVC Series For Beginners: Part 1
  • 19. QUESTION/ANSWER Surely, you should have questions, it is hard to discuss all the questions, please compile your questions and shoot me an email.
  • 20. FEEDBACK This is a series of sessions, today we covered very basics of asp.net mvc part. In coming session we will cover new and some advanced topics. Your feedback is very important. Provide your feedback so, I can share more worthful things with you.
  • 21. CONTINUES… Lets meet in next session …