ASP.NET MVC CRUSH COURSE,[object Object],ERDEM ERGİN,[object Object]
MVC Pattern – What is it?,[object Object],MVC - Acronym for Model/View/Controller,[object Object],Invented by TrygveReenskaug[1973 - 1978],[object Object],Originally used as an architectural pattern for GUIs.,[object Object],The first implementation of MVC was as part of Smalltalk-80 ,[object Object],class library. ,[object Object]
MVC Pattern – How does it work?,[object Object],The Controller asks the Model for data,[object Object],The request hits the controller,[object Object],Model,[object Object],2,[object Object],1,[object Object],3,[object Object],Controller,[object Object],User,[object Object],The Model gives the data back to the Controller,[object Object],The controller formats the data and passes them to the View,[object Object],View,[object Object],4,[object Object],5,[object Object],The view renders the HTML that needs to be sent to the client,[object Object],3,[object Object]
MVC Pattern – Who uses it?,[object Object],.NET has Spring.NET, MonoRail,[object Object],Java has Swing, Struts, Grails and others,[object Object],Perl has Catalyst, Gantry, Jifty and others,[object Object],PHP has Zend, Zoop, Agavi and others,[object Object],Python has Django, Gluon, Pylon and others,[object Object],Ruby has Ruby on Rails,[object Object],Apple has cocoa and cocoa touch for objective-c [Mac, iPhone],[object Object]
MVC FrameworkHistory,[object Object],Based on Python,[object Object],1970S,[object Object],….,[object Object],2003 RoR,[object Object],{ ASP.NET MVC },[object Object],2009.3 MVC1 ,[object Object],2010.4 MVC2,[object Object]
ASP.NET MVC,[object Object],[object Object]
 No more “postbacks” and “ViewStates”
 Built on top of ASP.NETAdvantages,[object Object],[object Object]
More control over your html and JavaScript
Friendly URLS
More easily Testable Framework.
All ASP.Net providers still work [Membership, Session, Caching, etc]
Extensible and Pluggable [Support replacing any component],[object Object]
ASP.NET MVC Execution Process,[object Object]
DEMO,[object Object],Create New ASP.NET MVC Project,[object Object],Investigate ASP.NET MVC Structure,[object Object]
Routing,[object Object],MVC+R,[object Object],R => the hidden character,[object Object]
ASP.NET MVC Routing,[object Object],URL Patterns,[object Object],Setting Default Values for URL Parameters,[object Object],Adding Constraints to Routes,[object Object],Scenarios When Routing Is Not Applied,[object Object],How URLs Are Matched to Routes,[object Object],Accessing URL Parameters in a Routed Page,[object Object],ASP.NET Routing and Security,[object Object],ASP.NET Routing versus URL Rewriting,[object Object]
Model [M],[object Object],Validation,[object Object]
Controller [C],[object Object],Controlling the flow of application execution,[object Object]
ASP.NET MVC Controller,[object Object],Controller is a class consisting of a set of action methods.,[object Object], Responsible for ,[object Object],Handling user interaction,[object Object],Working with the models,[object Object],Selecting a view to render,[object Object],Sending model and information  to a particular view,[object Object],Making decisions for security, UI, redirects ... etc.,[object Object],The ASP.Net MVC requires the names of all controllers to end with the suffix  "Controller“  e.g.  HomeController, LoginController,[object Object]
ASP.NET MVC Controller,[object Object],A controller action always returns an ActionResult,[object Object],What if I return an object ??,[object Object],Action return ActionResult which can be,[object Object],[object Object]
EmptyResult=> no result.
RedirectResult	=> redirection to a new URL.
JsonResult		=> json result that can be used in an AJAX application.
JavaScriptResult	=> JavaScript script.
ContentResult	=> text result [and wraps any non ActionResult return Type].
FileContentResult	=> downloadable file [with the binary content].
FilePathResult	=> downloadable file [with a path].
FileStreamResult	=> a downloadable file [with a file stream]. Note: all public methods of a controller class consideredas action methods, if you don’t want a public method to be an action, mark it with [NonAction()] attribute,[object Object]
ASP.NET MVC Controller Filter,[object Object]
View [V],[object Object]
ASP.NET MVC View,[object Object],Responsible for presentation, look & feel, formatting, sorting … etc. ,[object Object],Interacts with model but shouldn’t make decisions ,[object Object],No logic should go there,[object Object],Code Behind exists but not recommended,[object Object],No View State, No Server Controls,[object Object],HTML Helpers,[object Object],Takes the view data from the controller,[object Object],Can be strong typed  ,[object Object],Can be extended by implementing View Engines,[object Object],Always build your views !!!,[object Object]
An HTML Helper is just a method that returns a string.,[object Object],• Html.ActionLink(),[object Object],• Html.BeginForm(),[object Object],• Html.CheckBox(),[object Object],• Html.DropDownList(),[object Object],• Html.EndForm(),[object Object],• Html.Hidden(),[object Object],• Html.ListBox(),[object Object],• Html.Password(),[object Object],• Html.RadioButton(),[object Object],• Html.TextArea(),[object Object],• Html.TextBox(),[object Object],e.g.,[object Object],ASP.NET MVC View,[object Object]
Extensibility,[object Object]
The default ASP.NET MVC Pipeline,[object Object],21,[object Object]
1 de 35


Struts 2 OverviewStruts 2 Overview
Struts 2 Overviewskill-guru
2.6K visualizações16 slides
Introducing Struts 2Introducing Struts 2
Introducing Struts 2wiradikusuma
2.6K visualizações25 slides
MVC ppt presentationMVC ppt presentation
MVC ppt presentationBhavin Shah
14K visualizações36 slides
01 introduction to struts201 introduction to struts2
01 introduction to struts2Smita B Kumar
642 visualizações28 slides
Backbone jsBackbone js
Backbone jsKnoldus Inc.
1.5K visualizações37 slides

Mais conteúdo relacionado

Mais procurados

Struts2Rajiv Gupta
6.4K visualizações105 slides
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCLearnNowOnline
1.5K visualizações112 slides
ASP .net MVCASP .net MVC
ASP .net MVCDivya Sharma
5.4K visualizações26 slides
Struts 1Struts 1
Struts 1Lalit Garg
2.4K visualizações42 slides
MSDN - ASP.NET MVCMaarten Balliauw
6K visualizações26 slides
Spring Web MVCSpring Web MVC
Spring Web MVCzeeshanhanif
10.6K visualizações44 slides

Mais procurados(20)

Rajiv Gupta6.4K visualizações
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
LearnNowOnline1.5K visualizações
ASP .net MVCASP .net MVC
ASP .net MVC
Divya Sharma5.4K visualizações
Struts 1Struts 1
Struts 1
Lalit Garg2.4K visualizações
Maarten Balliauw6K visualizações
Spring Web MVCSpring Web MVC
Spring Web MVC
zeeshanhanif10.6K visualizações
Ni 1.1K visualizações
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVC
Richard Paul6.4K visualizações
Introduction to strutsIntroduction to struts
Introduction to struts
Mindfire Solutions2.3K visualizações
Unit testing and MVVM in SilverlightUnit testing and MVVM in Silverlight
Unit testing and MVVM in Silverlight
Devnology1.3K visualizações
Jinal desai .netJinal desai .net
Jinal desai .net
rohitkumar1987in321 visualizações
Real-world Model-View-ViewModel for WPFReal-world Model-View-ViewModel for WPF
Real-world Model-View-ViewModel for WPF
Paul Stovell6.5K visualizações
Spring MVC Architecture TutorialSpring MVC Architecture Tutorial
Spring MVC Architecture Tutorial
Java Success Point2.3K visualizações
Mvc architectureMvc architecture
Mvc architecture
Surbhi Panhalkar44.4K visualizações
Struts ppt 1Struts ppt 1
Struts ppt 1
pavanteja862.6K visualizações
Introduction to mvc architectureIntroduction to mvc architecture
Introduction to mvc architecture
ravindraquicsolv1.3K visualizações
ASP .NET MVC Introduction & Guidelines  ASP .NET MVC Introduction & Guidelines
ASP .NET MVC Introduction & Guidelines
Dev Raj Gautam1.2K visualizações
Beginning AngularJSBeginning AngularJS
Beginning AngularJS
Troy Miles1.6K visualizações
Scott Stanlick3.8K visualizações
Spring MVC BasicsSpring MVC Basics
Spring MVC Basics
Bozhidar Bozhanov12.4K visualizações

Similar a mvc

Inside mvc frameworkInside mvc framework
Inside mvc frameworkCiklum Ukraine
249 visualizações23 slides
Inside ASP.NET MVC frameworkInside ASP.NET MVC framework
Inside ASP.NET MVC frameworkCiklum Ukraine
653 visualizações23 slides
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamentalldcphuc
4.9K visualizações22 slides
Introduction To MvcIntroduction To Mvc
Introduction To MvcVolkan Uzun
2.4K visualizações28 slides
Controllers & actionsControllers & actions
Controllers & actionsEyal Vardi
834 visualizações19 slides

Similar a mvc(20)

Inside mvc frameworkInside mvc framework
Inside mvc framework
Ciklum Ukraine249 visualizações
Inside ASP.NET MVC frameworkInside ASP.NET MVC framework
Inside ASP.NET MVC framework
Ciklum Ukraine653 visualizações
ASP.NET MVC FundamentalASP.NET MVC Fundamental
ASP.NET MVC Fundamental
ldcphuc4.9K visualizações
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
Volkan Uzun2.4K visualizações
Controllers & actionsControllers & actions
Controllers & actions
Eyal Vardi834 visualizações
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnan
Gigin Krishnan769 visualizações
Build your website with angularjs and web apisBuild your website with angularjs and web apis
Build your website with angularjs and web apis
Chalermpon Areepong2.1K visualizações
Barry Gervin7.2K visualizações
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
Stefano Paluello7.9K visualizações
ASP.MVC TrainingASP.MVC Training
ASP.MVC Training
Mahesh Sikakolli2K visualizações
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Sunpawet Somsin4.1K visualizações
Vasilios Kuznos354 visualizações
angularJs WorkshopangularJs Workshop
angularJs Workshop
Ran Wahle509 visualizações
Spring MVC 3.0 FrameworkSpring MVC 3.0 Framework
Spring MVC 3.0 Framework
Ravi Kant Soni ( visualizações Mvc Mvc 5 Mvc 5
ahmedxp kh73 visualizações
ASP.NET MVC ExtensibilityASP.NET MVC Extensibility
ASP.NET MVC Extensibility
Simone Chiaretta3.1K visualizações
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
Ran Wahle510 visualizações
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
Naga Muruga43 visualizações mvc