1 / 5

ASP.NET MVC

ASP.NET MVC. The Basic Big Picture Juhani Välimäki 12.2.2013. Web Server. Browser / Client. Global.asax. Request protocol , e.g . http:// Server name , e.g . myy.haaga-helia.fi Port, e.g . 8080 More URI, e.g . Controller /Home , Action /Index Possible parameters Verb :

prince
Télécharger la présentation

ASP.NET MVC

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ASP.NET MVC The Basic Big Picture Juhani Välimäki 12.2.2013

  2. Web Server Browser / Client Global.asax • Request • protocol, e.g. http:// • Server name, e.g. myy.haaga-helia.fi • Port, e.g. 8080 • More URI, e.g. Controller /Home, Action /Index • Possibleparameters • Verb: • GET|POST URI mapper Controller’sactionsfetchorcreate the Model, possiblyupdating it. Controller Action Controller passes the (possiblymodified) Model to anydesiredView Model URI link Data XHTML pages with form and input elements. And links View • Response • XHTML page with links for sendingrequestsback to Web server • Possible XHTML formelement with input fields and submitelements • Referenced .css/.jpg/.js etc. files _Layout.cshtml The Viewparses data from the Modelto the elements of the View (page) and adds Action links to the page forthe nextround of Request-Resp Index.cshtml

  3. Browser / Client Web Server • Global.asaxconfig file: • defaultcontrollers, actions & parameters • ways to parseprovidedcontroller, action and/orparameterinformation Global.asax URI mapper • URI mapping • whichcontroller? • which action? • whichparameterized version of the action? • Anyincoming URI canbemapped to anyinternal URI! All, including the Controller, Action and Parameters, is customizable! Controller Action Model URI link Data XHTML pages with form and input elements. And links View _Layout.cshtml Index.cshtml

  4. Modelcouldbe, e.g.: • Single DTO object • Collection of DTO objects • Complicatedobjectreferencestructure • (Interfaceclassorobject for database, evensomeBusiness LogicLayeror DAO object) • Proxy object for socalled ORM Web Server Browser / Client Global.asax URI mapper • Model is passivefrom MVC point of view • Controller createsorfetches the Modele.g. from DB/ORM/EDM • Also the Viewwillbegivenaccess to the Model • (=”Also the View is in controlof/knows the Model”) • Modeldoesn’tknow the Control nor the View • YetModelcanruncodeifasked to Controller Action Model URI link XHTML pages with form and input elements. And links Data View _Layout.cshtml Index.cshtml

  5. Web Server Browser / Client Global.asax URI mapper Controller Action Model URI link Data XHTML pages with form and input elements. And links View • View is formed: • From the ”masterpage” part/Views/Shared/_Layout.cshtml • Viewpartwillbeadded inside. E.g. /Views/Home/Index.cshtml is the HomeController’s Index action’sviewcontent • Possible_Partialviews(underscore) • Use Visual Studio to auto-createanyfoldersorfilessothatlinkageswork _Layout.cshtml Index.cshtml

More Related