Presentation is loading. Please wait.

Presentation is loading. Please wait.

ASP.NET MVC 2.0 2009-12-23. Intro class MainContoller { function Index() {... raw data HTML CSS JavaScript REQUEST RESPONSE.

Similar presentations


Presentation on theme: "ASP.NET MVC 2.0 2009-12-23. Intro class MainContoller { function Index() {... raw data HTML CSS JavaScript REQUEST RESPONSE."— Presentation transcript:

1 ASP.NET MVC 2.0 2009-12-23

2 Intro class MainContoller { function Index() {... raw data HTML CSS JavaScript http://localhost/Main/Index REQUEST RESPONSE CONTROLLER MODELVIEW

3 Sample public class MainController : Controller { public ActionResult Index(int id) { var model = new MainModel(id); return View(“Index”, model); } public class MainModel { public int Id; public string Title; public string Content; } MainController.cs MainModel.csIndex.aspx

4 ASPX vs PHP public class MainController : Controller { public ActionResult Index(int id) { var model = new MainModel(id); return View(“Index”, model); } ” /> MainController.cs Index.aspx class MainController implements Controller { public function Index($id) { $model = new MainModel($id); return $this->View(“Index”, model); } MainController.php Title ?> Content ?> FindFile(“image.jpg”) ?>” /> Index.php

5 ASP.NET MVC 1.0 community (ms-pl) MVC frame url rewriting and routing basic validation helpers (html generators) page caching

6 ASP.NET MVC 2.0 templated helpers areas support for Data Annotations client validation AsyncController strongly-typed input helpers bug fixes, minor features

7 Sample 1 public class ProductViewModel { [Price(MinPrice = 1.99)] public double Price { get; set; } [Required] public string Title { get; set; } }

8 Sample 2 [ChildActionOnly] public ActionResult Menu() { var menu =... return PartialView(menu); } Partial rendering - builds a string and then sends to output - direct outtput

9 Community developers extra helpers T4 templates localization programming techniques blogs, tutorials partial caching (donut caching) webshop (cart, order, PayPal) Oxite

10 Road map MVC (pattern) – 1979 ASP.NET MVC 1.0 – 17th mar 2009 ASP.NET MVC 2.0 RC – 17th dec 2009 ASP.NET MVC 2.0 – ?, integrated in VS2010

11 Links http://haacked.com http://www.asp.net/mvc/gallery http://aspnet.codeplex.com Wikipedia: MVC


Download ppt "ASP.NET MVC 2.0 2009-12-23. Intro class MainContoller { function Index() {... raw data HTML CSS JavaScript REQUEST RESPONSE."

Similar presentations


Ads by Google