ASP.NET MVC 3 Introduction Twitter: @tomijuhola [email_address] +358 44 033 8639 <ul><li>Tomi Juhola, 14.6.2011 </li></ul>...
Motivation? Target? <ul><li>Needed to do slides about ASP.NET MVC </li></ul><ul><li>Made promises </li></ul><ul><li>Hard t...
Agenda <ul><li>ASP.NET WEBFORMS VS. ASP.NET MVC </li></ul><ul><li>ROUTING  – FROM REQUEST TO FUNCTION CALLS </li></ul><ul>...
ASP.NET WebForms VS.  ASP.NET MVC 01
ASP.NET WebForms <ul><li>Drag ’n drop GUI programming on web? </li></ul><ul><li>Abstraction layer </li></ul><ul><li>Issues...
ASP.NET MVC X <ul><li>New model  (ALT.NET):  </li></ul><ul><ul><li>Dec 2007 ASP.NET MVC CTP </li></ul></ul><ul><ul><li>Mar...
ASP.NET MVC benefits <ul><li>Familiar MVC architecture </li></ul><ul><ul><li>Close to HTTP: Request, update data, provide ...
Model – View - Controller <ul><li>Models implement the logic of the application </li></ul><ul><li>Views display data and p...
Project structure <ul><li>App_Data, e.g. resource files </li></ul><ul><li>Content CSS, images, etc. </li></ul><ul><li>Cont...
Routing – from requests to function calls 02
Routing <ul><li>ASP.NET MVC uses standard ASP.NET routing to direct HTTP requests to correct handlers (correct controller'...
Registering routes <ul><li>public class MvcApplication : System.Web.HttpApplication </li></ul><ul><li>{ </li></ul><ul><li>...
MVC request handling Order no Stage Details 0 Receive first request for the application In the Global.asax file, Route obj...
Route default values <ul><li>public static void RegisterRoutes(RouteCollection routes) </li></ul><ul><li>{ </li></ul><ul><...
Controllers and actions 03
Controllers and Actions <ul><li>Naming convention: xxxController </li></ul><ul><li>Requested URLs are mapped to Controller...
ActionResult <ul><li>Base class for return values from actions </li></ul><ul><li>Types (with helper method): </li></ul><ul...
Non-action methods in Controller <ul><li>[NonAction]   </li></ul><ul><li>p ublic  void DoSomething()  </li></ul><ul><li>{ ...
View – displaying data 04
Views <ul><li>Responsible for displaying data </li></ul><ul><li>HTML & simple code </li></ul><ul><ul><li>If you’re doing c...
Site master (or _Layout.cshtml in Razor) <ul><li>Can be located from /Views/Shared/Site.Master  (_Layout.cshtml) </li></ul...
HTML Helpers <ul><li>Used to create simple HTML elements (styling in CSS) </li></ul><ul><li>Easy to tie into Models </li><...
Partial views <ul><li>Used to follow DRY principle (Don’t Repeat Yourself) </li></ul><ul><li>Used to define a view that ca...
View engines <ul><li>ASP.NET MVC 3 adds also a new view engine: Razor </li></ul><ul><ul><li>There are others also availabl...
Razor vs. traditional WebEngine <ul><li>Traditional </li></ul><ul><ul><li><% if (Model.Value==true)%> </li></ul></ul><ul><...
Passing data 05
Method parameters <ul><li>By default, the parameters are retrieved from the request's data collection </li></ul><ul><ul><l...
Passing data to view <ul><li>Multiple choices: </li></ul><ul><ul><li>ViewData:  ViewData[”name”]=”Matti”; </li></ul></ul><...
Strongly typed views & Scaffolding <ul><li>When creating a view you can define the model class for the view </li></ul><ul>...
Strongly typed HtmlHelpers <ul><li>Named like: Html.NnnnFor(..) </li></ul><ul><ul><li>Html.TextBoxFor(..) </li></ul></ul><...
Form handling? <ul><li>Starting a form: </li></ul><ul><ul><li><%  using(Html.BeginForm(&quot;HandleForm&quot;, &quot;Home&...
Easiest way to map? <ul><li>From NerdDinner: </li></ul><ul><li>public  ActionResult Edit(int  id,  FormCollection formValu...
What next? <ul><li>Validation </li></ul><ul><li>ASP.NET MVC and jQuery </li></ul><ul><li>Data access in ASP.NET MVC apps <...
Further reading (books for MVC 3 coming soon…) <ul><li>Professional ASP.NET MVC 2 by Jon Galloway, Scott Hanselman, Phil H...
Web resources <ul><li>Official MVC site </li></ul><ul><ul><li>http://www.asp.net/mvc </li></ul></ul><ul><li>Blogs: </li></...
Example web apps <ul><li>http://nerddinner.codeplex.com/ </li></ul><ul><li>http://flickrxplorer.codeplex.com/ </li></ul><u...
www.lindorff.fi Thanks! Tomi Juhola Development Lead Puh: 010 2700 00, Faksi: 010 2700 100 GSM: 044 033 8639 [email_addres...
Upcoming SlideShare
Loading in …5
×

ASP.NET MVC introduction

4,096 views
3,960 views

Published on

Basic ASP.NET MVC introduction used to guide through a few hour workshop @Turku

Published in: Technology
0 Comments
10 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,096
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
0
Comments
0
Likes
10
Embeds 0
No embeds

No notes for slide

ASP.NET MVC introduction

  1. 1. ASP.NET MVC 3 Introduction Twitter: @tomijuhola [email_address] +358 44 033 8639 <ul><li>Tomi Juhola, 14.6.2011 </li></ul>Versio: | Status: | Päivitetty: 0.1 Luonnos Tomi Juhola, 14.06.2011
  2. 2. Motivation? Target? <ul><li>Needed to do slides about ASP.NET MVC </li></ul><ul><li>Made promises </li></ul><ul><li>Hard to find professional ASP.NET MVC developers </li></ul><ul><li>TARGET: </li></ul><ul><ul><li>Get you everyone into basic ideas of ASP.NET MVC </li></ul></ul><ul><ul><li>Make it easy to start developing simple web applications </li></ul></ul>
  3. 3. Agenda <ul><li>ASP.NET WEBFORMS VS. ASP.NET MVC </li></ul><ul><li>ROUTING – FROM REQUEST TO FUNCTION CALLS </li></ul><ul><li>CONTROLLER S & ACTION S </li></ul><ul><li>VIEW – DISPLAYING DATA </li></ul><ul><li>PASSING DATA </li></ul>
  4. 4. ASP.NET WebForms VS. ASP.NET MVC 01
  5. 5. ASP.NET WebForms <ul><li>Drag ’n drop GUI programming on web? </li></ul><ul><li>Abstraction layer </li></ul><ul><li>Issues: </li></ul><ul><ul><li>ViewState: Slow, hard to control </li></ul></ul><ul><ul><li>Page life cycle </li></ul></ul><ul><ul><li>No actual separation of concerns </li></ul></ul><ul><ul><li>Very tight architecture (hard to e.g. unit test) </li></ul></ul><ul><ul><li>No control over HTML </li></ul></ul>
  6. 6. ASP.NET MVC X <ul><li>New model (ALT.NET): </li></ul><ul><ul><li>Dec 2007 ASP.NET MVC CTP </li></ul></ul><ul><ul><li>March 2009 ASP.NET MVC 1 </li></ul></ul><ul><li>Rapid development: </li></ul><ul><ul><li>March 2010 ASP.NET MVC 2 </li></ul></ul><ul><ul><li>Jan 2011 ASP.NET MVC 3 </li></ul></ul><ul><ul><li>Dec 2011 ASP.NET MVC 4? </li></ul></ul><ul><ul><ul><li>RTM already out! </li></ul></ul></ul>
  7. 7. ASP.NET MVC benefits <ul><li>Familiar MVC architecture </li></ul><ul><ul><li>Close to HTTP: Request, update data, provide response </li></ul></ul><ul><li>Extensible by design </li></ul><ul><li>Control over HTML & HTTP </li></ul><ul><li>Testable by design </li></ul><ul><li>Routing </li></ul><ul><li>Mature technology beneath (ASP.NET) </li></ul><ul><li>Modern API (.NET4, LINQ, lambda expr., extension methods etc.) </li></ul><ul><li>Open source (MS-PL licensed) </li></ul><ul><li>Convention over configuration </li></ul>
  8. 8. Model – View - Controller <ul><li>Models implement the logic of the application </li></ul><ul><li>Views display data and present the UI </li></ul><ul><li>Controllers handle user interactions, work with the models and select next view to display </li></ul><ul><li>-> Loose coupling, clear separation of concerns </li></ul>
  9. 9. Project structure <ul><li>App_Data, e.g. resource files </li></ul><ul><li>Content CSS, images, etc. </li></ul><ul><li>Controllers, hmm.. </li></ul><ul><ul><li>The names of all controllers have to end with &quot;Controller&quot; </li></ul></ul><ul><li>Models, model classes </li></ul><ul><li>Scripts, script files. By default, contains a bunch of js files. </li></ul><ul><li>Views, View files like ViewPage (.aspx), ViewUserControl (.ascx), and ViewMasterPage (.master) files. </li></ul>
  10. 10. Routing – from requests to function calls 02
  11. 11. Routing <ul><li>ASP.NET MVC uses standard ASP.NET routing to direct HTTP requests to correct handlers (correct controller's action) </li></ul><ul><ul><li>Enables use of URLs that don't map to specific files </li></ul></ul><ul><li>Easier to read URLs </li></ul><ul><li>Routing also handles automatically url parameter parsing to objects etc. </li></ul><ul><li>Example route and routing rule: </li></ul><ul><ul><li>http://server/application/Products/show/beer, the routing parser passes the values Products, show, and beer to the page handler. </li></ul></ul><ul><ul><li>URL pattern can be e.g. server/application/{area}/{action}/{category} </li></ul></ul>
  12. 12. Registering routes <ul><li>public class MvcApplication : System.Web.HttpApplication </li></ul><ul><li>{ </li></ul><ul><li>public static void RegisterRoutes(RouteCollection routes) </li></ul><ul><li>{ </li></ul><ul><li>routes.IgnoreRoute(&quot;{resource}.axd/{*pathInfo}&quot;); </li></ul><ul><li>// MapRoute parameters: Route name, URL with parameters </li></ul><ul><li>// and parameter defaults </li></ul><ul><li>routes. MapRoute (&quot;Default&quot;, &quot;{controller}/{action}/{id}&quot;, </li></ul><ul><li>new { controller = &quot;Home&quot;, action = &quot;Index&quot;, id = &quot;&quot; } </li></ul><ul><li>); </li></ul><ul><li>} </li></ul><ul><li>protected void Application_Start() </li></ul><ul><li>{ </li></ul><ul><li>RegisterRoutes (RouteTable.Routes); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  13. 13. MVC request handling Order no Stage Details 0 Receive first request for the application In the Global.asax file, Route objects are added to the RouteTable object. 1. Perform routing The UrlRoutingModule module uses the first matching Route object in the RouteTable collection to create the RouteData object, which it then uses to create a RequestContext object. 2. Create MVC request handler The MvcRouteHandler object creates an instance of the MvcHandler class and passes the RequestContext instance to the handler. 3. Create controller The MvcHandler object uses the RequestContext instance to identify the IControllerFactory object (typically an instance of the DefaultControllerFactory class) to create the controller instance with. 4. Execute controller The MvcHandler instance calls the controller's Execute method. 5. Invoke action For controllers that inherit from the ControllerBase class, the ControllerActionInvoker object that is associated with the controller determines which action method of the controller class to call, and then calls that method. 6. Execute result The action method receives user input, prepares the appropriate response data, and then executes the result by returning a result type. The built-in result types that can be executed include the following: ViewResult (which renders a view and is the most-often used result type), RedirectToRouteResult, RedirectResult, ContentResult, JsonResult, FileResult, and EmptyResult.
  14. 14. Route default values <ul><li>public static void RegisterRoutes(RouteCollection routes) </li></ul><ul><li>{ </li></ul><ul><li>routes.MapRoute(&quot;Default&quot;, </li></ul><ul><li>&quot;Category/{action}/{categoryName}&quot;, </li></ul><ul><li>New { categoryName= &quot;food&quot;, action=&quot;show&quot;}); </li></ul><ul><li>} </li></ul>URL Parameter values /Category action = &quot;show&quot; (default value) categoryName = &quot;food&quot; (default value) /Category/add action = &quot;add&quot; categoryName = &quot;food&quot; (default value) /Category/add/beer action = &quot;add&quot; categoryName= &quot;beverages&quot;
  15. 15. Controllers and actions 03
  16. 16. Controllers and Actions <ul><li>Naming convention: xxxController </li></ul><ul><li>Requested URLs are mapped to Controller classes and Action methods </li></ul><ul><li>Base class for all controllers is Controller (and its base is ControllerBase) </li></ul><ul><ul><ul><li>public class MyController : Controller </li></ul></ul></ul><ul><ul><ul><li>{ </li></ul></ul></ul><ul><ul><ul><li>public ActionResult HelloWorld() </li></ul></ul></ul><ul><ul><ul><li>{ </li></ul></ul></ul><ul><ul><ul><li>ViewBag.Message = &quot;Hello World!&quot;; </li></ul></ul></ul><ul><ul><ul><li>return View(); </li></ul></ul></ul><ul><ul><ul><li>} </li></ul></ul></ul><ul><ul><ul><li>} </li></ul></ul></ul>
  17. 17. ActionResult <ul><li>Base class for return values from actions </li></ul><ul><li>Types (with helper method): </li></ul><ul><ul><li>ViewResult – Renders a Web page View() </li></ul></ul><ul><ul><li>PartialViewResult – Renders a partial view PartialView() </li></ul></ul><ul><ul><li>RedirectResult – Redirects to another URL Redirect() </li></ul></ul><ul><ul><li>RedirectToRouteResult – Redirects to action RedirectToAction()/-Route() </li></ul></ul><ul><ul><li>ContentResult – Returns a user def content Content() </li></ul></ul><ul><ul><li>JsonResult – returns serialized JSON object Json() </li></ul></ul><ul><ul><li>JavaScriptResult – returns JS script JavaScript() </li></ul></ul><ul><ul><li>FileResult – Returns binary output File() </li></ul></ul><ul><ul><li>EmptyResult - Same as null </li></ul></ul>
  18. 18. Non-action methods in Controller <ul><li>[NonAction] </li></ul><ul><li>p ublic void DoSomething() </li></ul><ul><li>{ </li></ul><ul><li>// L ogic. </li></ul><ul><li>} </li></ul>
  19. 19. View – displaying data 04
  20. 20. Views <ul><li>Responsible for displaying data </li></ul><ul><li>HTML & simple code </li></ul><ul><ul><li>If you’re doing complicated things in Views, you’re probably doing it wrong </li></ul></ul><ul><li>Convention: </li></ul><ul><ul><li>View returned by HomeController’s Index Action is ViewsHomeIndex.aspx </li></ul></ul><ul><li>Example View: </li></ul><ul><li><%@ Page Language=&quot;C#&quot; MasterPageFile=&quot;/Views/Shared/Site.Master&quot; Inherits=&quot;System.Web.Mvc.ViewPage&quot; %> </li></ul><ul><li><asp:Content ID=&quot;aboutContent&quot; ContentPlaceHolderID=&quot;MainContent&quot; runat=&quot;server&quot;> </li></ul><ul><li><h2>About</h2> </li></ul><ul><li><p> P ut content here. </p> </li></ul><ul><li></asp:Content> </li></ul>
  21. 21. Site master (or _Layout.cshtml in Razor) <ul><li>Can be located from /Views/Shared/Site.Master (_Layout.cshtml) </li></ul><ul><li>Used to create common page structure </li></ul><ul><li>Important parts: </li></ul><ul><ul><li>In Site.Master:   <asp:ContentPlaceHolder ID=&quot;MainContent&quot; runat=&quot;server&quot; /> </li></ul></ul><ul><ul><li>In actual pages: <%@ Page Title= ””  Language=&quot;C# ” MasterPageFile= ” ~/Views/Shared/Site.Master ”  Inherits= ” System.Web.Mvc.ViewPage< ModelType > ”  %> </li></ul></ul><ul><li>Include here: </li></ul><ul><ul><li>Common scripts </li></ul></ul><ul><ul><li>CSSs </li></ul></ul><ul><ul><li>Navigation etc. always visible bars </li></ul></ul>
  22. 22. HTML Helpers <ul><li>Used to create simple HTML elements (styling in CSS) </li></ul><ul><li>Easy to tie into Models </li></ul><ul><li>In views usable with following syntax: <% Html.ActionLink(…) %> </li></ul><ul><li>Can be extended by extension methods, or own classes can be created </li></ul><ul><li>Difference between <%: %>, <% %> and <%= %>? </li></ul><ul><ul><li>Renders with encoding, no rendering, renders withouth encoding </li></ul></ul><ul><li>Methods in HtmlHelper class ( http://msdn.microsoft.com/en-us/library/system.web.mvc.htmlhelper.aspx ) </li></ul><ul><ul><li>ActionLink, BeginForm, CheckBox, Display, DropDownList, Editor, Hidden, Label, ListBox, Partial, Password, RadioButton, RenderAction, RenderPartial, RouteLink, TextArea, TextBox, ValidationSummary, ValidationMessage etc. </li></ul></ul>
  23. 23. Partial views <ul><li>Used to follow DRY principle (Don’t Repeat Yourself) </li></ul><ul><li>Used to define a view that can be rendered inside parent view </li></ul><ul><li>For this ASP.NET user controls are used (.ascx) </li></ul><ul><li>Essential points: </li></ul><ul><ul><li>Shares same ViewData & ViewBag as parent </li></ul></ul><ul><ul><li>Can be also strongly typed </li></ul></ul><ul><li>Consider these for e.g. basic forms, views etc. for each type you have </li></ul><ul><ul><li>This way the views & forms are similar in each page </li></ul></ul>
  24. 24. View engines <ul><li>ASP.NET MVC 3 adds also a new view engine: Razor </li></ul><ul><ul><li>There are others also available: Bellevue, Brail, Hasic, NDjango, NHaml, NVelocity, SharpTiles, Spark, StringTemplate, WingBeats, Xslt </li></ul></ul><ul><ul><li>See: http://stackoverflow.com/questions/1451319/asp-net-mvc-view-engine-comparison and http://channel9.msdn.com/coding4fun/articles/Developer-Review-Four-ASPNET-MVC-View-Engines </li></ul></ul><ul><li>Instead of using <% … %> notation uses plain @ character. </li></ul><ul><li>E.g. </li></ul><ul><ul><li><h3>Hello, <%: name %>! </h3> vs. <h3>Hello, @name! </h3> </li></ul></ul><ul><ul><li><p>Now: <%: Datetime.Now %>! </p> vs. <p>Now: @DateTime.Now</p> </li></ul></ul>
  25. 25. Razor vs. traditional WebEngine <ul><li>Traditional </li></ul><ul><ul><li><% if (Model.Value==true)%> </li></ul></ul><ul><ul><li><%{>% </li></ul></ul><ul><ul><li><% var outsideTemp = 79; </li></ul></ul><ul><ul><li>var weatherMsg = &quot;Hello, it is &quot; + outsideTemp + &quot; degrees.&quot;; </li></ul></ul><ul><ul><li>%> </li></ul></ul><ul><ul><li><p>Today's weather: <%: weatherMsg %> </p> </li></ul></ul><ul><ul><li><%}%> </li></ul></ul><ul><li>Razor </li></ul><ul><ul><li>@if (Model.Value==true) { </li></ul></ul><ul><ul><li>@{ </li></ul></ul><ul><ul><li>var outsideTemp = 79; </li></ul></ul><ul><ul><li>var weatherMsg = &quot;Hello, it is &quot; + outsideTemp + &quot; degrees.&quot;; </li></ul></ul><ul><ul><li>} </li></ul></ul><ul><ul><li><p>Today's weather: @ weatherMsg </p> </li></ul></ul><ul><ul><li>} </li></ul></ul>
  26. 26. Passing data 05
  27. 27. Method parameters <ul><li>By default, the parameters are retrieved from the request's data collection </li></ul><ul><ul><li>Contains name/values pairs for form data, query string values, and cookie values. </li></ul></ul><ul><li>There are several ways to access URL parameter values in the action methods </li></ul><ul><ul><li>Request and Response properties </li></ul></ul><ul><ul><li>Automatically mapped parameters </li></ul></ul><ul><li>Examples with /Products/Detail?id=3 (or better /Products/Detail/3 , remember default routing?) </li></ul><ul><ul><ul><li>public void Detail() </li></ul></ul></ul><ul><ul><ul><li>{ </li></ul></ul></ul><ul><ul><ul><li>int id = Convert.ToInt32(Request[&quot;id&quot;]); </li></ul></ul></ul><ul><ul><ul><li>} </li></ul></ul></ul><ul><ul><ul><li>public ResultAction Detail(int id) </li></ul></ul></ul><ul><ul><ul><li>{ </li></ul></ul></ul><ul><ul><ul><li>// Logic (id is already usable here) </li></ul></ul></ul><ul><ul><ul><li>} </li></ul></ul></ul>
  28. 28. Passing data to view <ul><li>Multiple choices: </li></ul><ul><ul><li>ViewData: ViewData[”name”]=”Matti”; </li></ul></ul><ul><ul><li>ViewBag: ViewBag.Name = ”Matti”; </li></ul></ul><ul><ul><li>Model: </li></ul></ul><ul><ul><ul><li>var person = new Person(”Matti”); </li></ul></ul></ul><ul><ul><ul><li>return View(person); </li></ul></ul></ul><ul><ul><ul><li>--- </li></ul></ul></ul><ul><ul><ul><li><%: Model.Name %> </li></ul></ul></ul><ul><li>View should preferably be strongly typed with view specific model, use that to pass data </li></ul><ul><li>Simple messages (like ”data updated”) can be handled with ViewBag </li></ul><ul><ul><li>ViewData is more legacy way of doing this </li></ul></ul><ul><ul><li>If ViewData is used, use constants, instead of Magic Strings </li></ul></ul>
  29. 29. Strongly typed views & Scaffolding <ul><li>When creating a view you can define the model class for the view </li></ul><ul><ul><li>Can be also dynamic when the view is not strongly typed </li></ul></ul><ul><li>Strongly typed views allow also scaffolding of basic views </li></ul><ul><ul><li>So autogenerated forms, lists, details views etc. </li></ul></ul>
  30. 30. Strongly typed HtmlHelpers <ul><li>Named like: Html.NnnnFor(..) </li></ul><ul><ul><li>Html.TextBoxFor(..) </li></ul></ul><ul><ul><li>Html.EditorFor(..) </li></ul></ul><ul><ul><li>Html(TextAreaFor(..) </li></ul></ul><ul><li>Usage: </li></ul><ul><ul><li><%= Html.LabelFor(model => model.ProductionVersion) %> </li></ul></ul><ul><ul><li>Uses so called lambda syntax to strongly type the parameters </li></ul></ul><ul><li>Two kinds of strongly type helpers: </li></ul><ul><ul><li>Element level: TextBoxFor(), RadioButtonFor() </li></ul></ul><ul><ul><li>Model level + others: EditorFor(), ValidationMessageFor() </li></ul></ul>
  31. 31. Form handling? <ul><li>Starting a form: </li></ul><ul><ul><li><% using(Html.BeginForm(&quot;HandleForm&quot;, &quot;Home&quot;)) %> <% { %> <!-- Form content goes here --> <% } %> </li></ul></ul><ul><ul><li><% Html.BeginForm(); %> <!-- Form content goes here --> <% Html.EndForm(); %> </li></ul></ul><ul><li>Mapping: </li></ul><ul><ul><li>Enter your name: <%= Html.TextBox( ” name ” ) %> </li></ul></ul><ul><ul><li>public ActionResult HandleForm(string name ) {} </li></ul></ul><ul><li>Mapping from Form-data: </li></ul><ul><ul><li>User.Name = Request.Form[” name” ]; </li></ul></ul><ul><li>More about forms: http://msdn.microsoft.com/en-us/library/dd410596.aspx </li></ul>
  32. 32. Easiest way to map? <ul><li>From NerdDinner: </li></ul><ul><li>public  ActionResult Edit(int  id, FormCollection formValues ) </li></ul><ul><li>{ Dinner dinner = dinnerRepository.GetDinner(id); </li></ul><ul><li>UpdateModel(dinner, formValues); // Automatically updates </li></ul><ul><li>dinnerRepository.Save(); return RedirectToAction(&quot;Details&quot;, new {id=dinner.DinnerID }); </li></ul><ul><li>} </li></ul>
  33. 33. What next? <ul><li>Validation </li></ul><ul><li>ASP.NET MVC and jQuery </li></ul><ul><li>Data access in ASP.NET MVC apps </li></ul><ul><li>Custom HtmlHelpers </li></ul><ul><li>Unit testing ASP.NET MVC </li></ul><ul><li>Custom routing </li></ul><ul><li>Security: XSS, Cross-site request forgery, cookie stealing, error reporting etc. </li></ul><ul><li>Migration to MVC </li></ul><ul><li>MVC & Web Forms together? </li></ul><ul><li>Extending MVC, plugging in own handlers </li></ul><ul><li>Etc.etc.etc.etc. </li></ul>
  34. 34. Further reading (books for MVC 3 coming soon…) <ul><li>Professional ASP.NET MVC 2 by Jon Galloway, Scott Hanselman, Phil Haack, Scott Guthrie, Rob Conery (Wrox) </li></ul><ul><li>Pro ASP.NET MVC 2 Framework by Steven Sanderson (Apress) </li></ul><ul><li>Test-Drive ASP.NET MVC by Jonathan McCracken (Pragmatic bookshelf) </li></ul><ul><li>ASP.NET MVC 2 in Action by Jeffrey Palermo, Ben Scheirman, Jimmy Bogard etc. (Manning) </li></ul>
  35. 35. Web resources <ul><li>Official MVC site </li></ul><ul><ul><li>http://www.asp.net/mvc </li></ul></ul><ul><li>Blogs: </li></ul><ul><ul><li>http://weblogs.asp.net/scottgu/default.aspx </li></ul></ul><ul><ul><li>http://haacked.com/ </li></ul></ul><ul><ul><li>http://www.hanselman.com/blog/ </li></ul></ul><ul><ul><li>http://blog.maartenballiauw.be/ </li></ul></ul>
  36. 36. Example web apps <ul><li>http://nerddinner.codeplex.com/ </li></ul><ul><li>http://flickrxplorer.codeplex.com/ </li></ul><ul><li>http://kigg.codeplex.com/ </li></ul><ul><li>http://codecampserver.codeplex.com/ </li></ul><ul><li>http://orchardproject.net/ </li></ul><ul><li>http://cartrackr.codeplex.com/ </li></ul><ul><ul><li>In MVC 1, anyone care to rewrite it in ASP.NET MVC 3? </li></ul></ul>
  37. 37. www.lindorff.fi Thanks! Tomi Juhola Development Lead Puh: 010 2700 00, Faksi: 010 2700 100 GSM: 044 033 8639 [email_address] www.lindorff.fi Joukahaisenkatu 2 FI-20100 Turku

×