110 likes | 296 Views
.NET Dojo. ASP.NET MVC. Ben Scheirman http://flux88.com Principal Consultant Sogeti. ASP.NET MVC. Alternative to WebForms Automatic vs. Manual Transmission You’ll like it IF….. WebForms isn’t going away. Schedule. ASP.NET MVC Basics Hello World Lab Blog Demo MvcContrib
E N D
.NET Dojo ASP.NET MVC Ben Scheirman http://flux88.com Principal Consultant Sogeti
ASP.NET MVC • Alternative to WebForms • Automatic vs. Manual Transmission • You’ll like it IF….. • WebForms isn’t going away
Schedule • ASP.NET MVC Basics • Hello World Lab • Blog Demo • MvcContrib • Inversion of Control • Unit Testing Lab • Ajax • Wrapping up the Blog • Q & A
ASP.NET MVC Basics Model Controller View
What is a route? {controller}/{action}/{id} {year} / {month} / {day} => Controller: Posts => Action: List => Constraints year:\d{4} month:\d{2} day:\d{2} ? products / edit / 5 customers / list users / new 2008/08/28 2008/08 2008
What about Controller? ? Route values: Controller: “customers” Action: “list” public class CustomersController : Controller { public ActionResult List() { ... } }
Rendering the view? public ActionResult List() { string message = “a message for the view”; return View(“list”, message); } ? //List.aspx <div> The message is <%= ViewData.Model %> </div>
Hello World LAB Open: Labs\1-Hello World\NET Dojo - Lab 1 - Hello World.docx
Hello World LAB Open: Labs\1-Hello World\NET Dojo - Lab 1 - Hello World.docx