90 likes | 311 Vues
MVC - Common pitfalls and how to resolve them. Andrei Ignat , C# MVP http://msprogrammer.serviciipeweb.ro / Ubisoft Romania. Huge thanks to our sponsors !. Agenda. What is MVC? Routing and slug routing Validation Ajax requests and error handling Testing : ViewModels , browser.
E N D
MVC - Common pitfalls and how to resolve them Andrei Ignat , C# MVP http://msprogrammer.serviciipeweb.ro/ Ubisoft Romania
Agenda • What is MVC? • Routing and slug routing • Validation • Ajax requests and error handling • Testing : ViewModels, browser
Routing and slug routing • Example of routing • Intercepting controller errors • Demo: • http://haacked.com/archive/2010/02/21/manipulating-action-method-parameters.aspx • Homework: http://www.jefclaes.be/2012/01/autocorrecting-unknown-actions-using.html
Validation • Model validation • Unobtrusive • Ajax with partial views • Demo • Homework: Validation for a list.
Ajax requests and error handling • Simple Ajax request • GET/POST • Demo • http://msprogrammer.serviciipeweb.ro/2011/12/05/jquery-ajax-request-and-mvcdetailed/ • Homework: Ajax for a list – see http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx
Testing : ViewModels, browser • Test ViewModels • Mocking • Demo • Testing Browser • Demo: Selenium • Homework: Ajax test – HttpWebRequest.
Thank you ! Andrei Ignat , C# MVP http://msprogrammer.serviciipeweb.ro/ ignatandrei@yahoo.com Q & A