SlideShare une entreprise Scribd logo
1  sur  27
Soe Tun
http://geekswithblogs.net/stun
Twitter: @SoeLinn
Soe Tun
    American College of Cardiology (ACC)
    Email: soelinn@gmail.com
    Twitter: @SoeLinn
    Blog: http://geekswithblogs.net/stun/


DC .NET User Group
  Twitter: @dcdnug
  2400 N St. NW DC 20037
  http://dcdnug.org
Model




Controller           View
“Code Behind”
  (Controller)


Data Transfer Object
(Model, View Model)




HTML Template
    (View)
routes.MapRoute(
                                           name: “Default”,
                                           url: “{controller}/{action}/{id}”,
                                           defaults: new { controller = “Patient”, action = “Index” }
                                      );
 Most Specific




                  http://localhost/Patient/Index




                                                                                           public ActionResult Index()
                                                                                           {





                                                                                               IList<Patient> model = GetPatients();
                  http://localhost/Patient/                   PatientController
 Least Specific




                                                                                               return View(“Index”, model);
                                                                                           }




                  http://localhost/




Additional Info
http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx
http://www.asp.net/mvc/tutorials/asp-net-mvc-routing-overview-cs
http://haacked.com/archive/2010/02/12/asp-net-mvc-2-optional-url-parameters.aspx
Application Functionality
   User Interface
     Consistency
     Maintainability


   Data Binding
     Reliability
     Security
Web Forms                         ASP.NET MVC
   <asp:TextBox />                   Html.EditorFor(m => m.FirstName)
     Date
     Number (int, decimal, ...)
     String




   <asp:DropDownList />
     Foreign Keys
     Nullable<bool>




   <asp:CheckBox />
       Boolean
Web Forms
                                Ugly

              Themes



                          Cluttered




ASP.NET MVC
   Other HTML Helper methods
     Html.TextBox(“FirstName”);
     Html.DropDownList(“UidBloodType”);


   Html.EditorFor( m => m.FirstName )
     Strongly-Typed
     Intellisense
ASP.NET MVC “Themes/Skins”
    Matched on System.Type Name
      DateTime.ascx for DateTime




    Using UIHintAttribute
      [UIHint(“SelectionElement”)]
        public int UidBloodType { get; set; }




    Brad Wilson – ASP.NET MVC 2 Templates (series)
    http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-1-introduction.html
Page_Load and Postback
Web Forms




                                                                                                  ASP.NET MVC
Patient model                = service.GetPatient( id );
PatientViewModel viewModel   = Mapper.Map<Patient, PatientViewModel>(model);


viewModel.RaceCheckBoxes = GetRaceSelections(model.UidPatient);
viewModel.BloodTypes     = new SelectList(service.GetBloodTypes(), "UidBloodType", "BloodTypeDesc", model.UidBloodType);


return View("Edit", viewModel);
Web Forms




                1. View Model
                2. Data Binding
                3. Server-Side Validation

  ASP.NET MVC
T4 - Text Template Transformation Toolkit
   T4 Toolbox
    o   http://t4toolbox.codeplex.com/




   Microsoft SQL Server 2008 SDK
       C:Program Files (x86)Microsoft SQL Server100SDKAssemblies
        ▪ Microsoft.SqlServer.ConnectionInfo.dll
        ▪ Microsoft.SqlServer.Management.Sdk.Sfc.dll
        ▪ Microsoft.SqlServer.Smo.dll
   Leave [Custom Tool] property empty for all
    files with .t4 extension.
Model Metadata = Presentation + Validation
   Presentation
         [DisplayName]              and      [Display].NET 4.0
         [HiddenInput]




       Validation
         [StringLength]
         [RegularExpression]



Brad Wilson – ASP.NET MVC 2 Templates (series)
http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmetadata.html
http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-4-custom-object-templates.html
   ASP.NET MVC 3
     Built-in support for Validation Summary with jQuery
     http://geekswithblogs.net/stun/archive/2011/01/28/aspnet-mvc-3-client-side-
     validation-summary-with-jquery-validation-unobtrusive-javascript.aspx
WebForms                        ASP.NET MVC



Web Controls               Html.EditorFor()




Themes / Skins             Use View Templates




Validation                 Attributes from Data Annotations



                            View Models
Data Binding               and
                            ViewData[“PropertyName”] = value;
Thank you! 




Soe Tun
http://geekswithblogs.net/stun
Twitter: @SoeLinn
Email: soelinn@gmail.com
   Phil Haack
    Custom Validation Attributes
    http://haacked.com/archive/2009/11/19/aspnetmvc2-custom-validation.aspx



   Kazi Manzur
    Post-Redirect-Get (PRG) Pattern
    http://weblogs.asp.net/rashid/archive/2009/04/01/asp-net-mvc-best-practices-part-1.aspx
    http://weblogs.asp.net/rashid/archive/2009/04/03/asp-net-mvc-best-practices-part-2.aspx


   Martijn Boland
    Paging with ASP.NET MVC
    http://blogs.taiga.nl/martijn/2008/08/27/paging-with-aspnet-mvc/
    Note: I modified his code a little bit in my demo project.

Contenu connexe

Tendances

Introduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developersIntroduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developers
AoteaStudios
 
Amazon Cognito使って認証したい?それならSpring Security使いましょう!
Amazon Cognito使って認証したい?それならSpring Security使いましょう!Amazon Cognito使って認証したい?それならSpring Security使いましょう!
Amazon Cognito使って認証したい?それならSpring Security使いましょう!
Ryosuke Uchitate
 

Tendances (20)

Introduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developersIntroduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developers
 
Présentation et bonnes pratiques du pattern MVVM - MIC Belgique
Présentation et bonnes pratiques du pattern MVVM - MIC BelgiquePrésentation et bonnes pratiques du pattern MVVM - MIC Belgique
Présentation et bonnes pratiques du pattern MVVM - MIC Belgique
 
Developing ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller PatternDeveloping ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller Pattern
 
Struts tutorial
Struts tutorialStruts tutorial
Struts tutorial
 
Summer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and ScalaSummer - The HTML5 Library for Java and Scala
Summer - The HTML5 Library for Java and Scala
 
Scrollable Test App
Scrollable Test AppScrollable Test App
Scrollable Test App
 
Understanding backbonejs
Understanding backbonejsUnderstanding backbonejs
Understanding backbonejs
 
Ajax
AjaxAjax
Ajax
 
Xml http request
Xml http requestXml http request
Xml http request
 
SpringOne 2GX 2013 - Spring Testing
SpringOne 2GX 2013 - Spring TestingSpringOne 2GX 2013 - Spring Testing
SpringOne 2GX 2013 - Spring Testing
 
Amazon Cognito使って認証したい?それならSpring Security使いましょう!
Amazon Cognito使って認証したい?それならSpring Security使いましょう!Amazon Cognito使って認証したい?それならSpring Security使いましょう!
Amazon Cognito使って認証したい?それならSpring Security使いましょう!
 
BackboneJs
BackboneJsBackboneJs
BackboneJs
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel
 
Jsp intro
Jsp introJsp intro
Jsp intro
 
New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)
 
Drupal8Day: Demystifying Drupal 8 Ajax Callback commands
Drupal8Day: Demystifying Drupal 8 Ajax Callback commandsDrupal8Day: Demystifying Drupal 8 Ajax Callback commands
Drupal8Day: Demystifying Drupal 8 Ajax Callback commands
 
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel AppelBuilding Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
 
JavaScript JQUERY AJAX
JavaScript JQUERY AJAXJavaScript JQUERY AJAX
JavaScript JQUERY AJAX
 
Form認証で学ぶSpring Security入門
Form認証で学ぶSpring Security入門Form認証で学ぶSpring Security入門
Form認証で学ぶSpring Security入門
 
Planbox Backbone MVC
Planbox Backbone MVCPlanbox Backbone MVC
Planbox Backbone MVC
 

En vedette (17)

123
123123
123
 
Digital storytelling
Digital storytellingDigital storytelling
Digital storytelling
 
Portfolio2
Portfolio2Portfolio2
Portfolio2
 
Algorithms as Microservices
Algorithms as MicroservicesAlgorithms as Microservices
Algorithms as Microservices
 
Fyp template
Fyp templateFyp template
Fyp template
 
졸전아이디어
졸전아이디어졸전아이디어
졸전아이디어
 
주름에 가장 효과적인 방법
주름에 가장 효과적인 방법주름에 가장 효과적인 방법
주름에 가장 효과적인 방법
 
Ppt
PptPpt
Ppt
 
Midterm
MidtermMidterm
Midterm
 
2주차 service design
2주차 service design2주차 service design
2주차 service design
 
Tratamiento de agua.
Tratamiento de agua.Tratamiento de agua.
Tratamiento de agua.
 
기말최종피티
기말최종피티기말최종피티
기말최종피티
 
Design management case analysis
Design management  case analysisDesign management  case analysis
Design management case analysis
 
Origami research
Origami researchOrigami research
Origami research
 
Origami app
Origami appOrigami app
Origami app
 
Usability test
Usability testUsability test
Usability test
 
사용성테스트
사용성테스트사용성테스트
사용성테스트
 

Similaire à Retrofit Web Forms with MVC & T4

Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
Aren Zomorodian
 
Asp.net MVC - Course 2
Asp.net MVC - Course 2Asp.net MVC - Course 2
Asp.net MVC - Course 2
erdemergin
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour
Dilip Patel
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mohammad Shaker
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
Spiffy
 

Similaire à Retrofit Web Forms with MVC & T4 (20)

Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Spring Web MVC
Spring Web MVCSpring Web MVC
Spring Web MVC
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
 
Asp.NET MVC
Asp.NET MVCAsp.NET MVC
Asp.NET MVC
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Asp.net MVC - Course 2
Asp.net MVC - Course 2Asp.net MVC - Course 2
Asp.net MVC - Course 2
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 
Introduction to Spring MVC
Introduction to Spring MVCIntroduction to Spring MVC
Introduction to Spring MVC
 
MVC & SQL_In_1_Hour
MVC & SQL_In_1_HourMVC & SQL_In_1_Hour
MVC & SQL_In_1_Hour
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
Mvc acchitecture
Mvc acchitectureMvc acchitecture
Mvc acchitecture
 
Asp.net mvc training
Asp.net mvc trainingAsp.net mvc training
Asp.net mvc training
 
Spring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topicsSpring 3.x - Spring MVC - Advanced topics
Spring 3.x - Spring MVC - Advanced topics
 
Practical OData
Practical ODataPractical OData
Practical OData
 
ASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin LauASP.NET Overview - Alvin Lau
ASP.NET Overview - Alvin Lau
 
ASP.NET MVC introduction
ASP.NET MVC introductionASP.NET MVC introduction
ASP.NET MVC introduction
 
Servlets
ServletsServlets
Servlets
 
ASP.NET MVC 4 Request Pipeline Internals
ASP.NET MVC 4 Request Pipeline InternalsASP.NET MVC 4 Request Pipeline Internals
ASP.NET MVC 4 Request Pipeline Internals
 
Asp Net Architecture
Asp Net ArchitectureAsp Net Architecture
Asp Net Architecture
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

Retrofit Web Forms with MVC & T4

  • 2.
  • 3. Soe Tun  American College of Cardiology (ACC)  Email: soelinn@gmail.com  Twitter: @SoeLinn  Blog: http://geekswithblogs.net/stun/ DC .NET User Group  Twitter: @dcdnug  2400 N St. NW DC 20037  http://dcdnug.org
  • 5. “Code Behind” (Controller) Data Transfer Object (Model, View Model) HTML Template (View)
  • 6. routes.MapRoute( name: “Default”, url: “{controller}/{action}/{id}”, defaults: new { controller = “Patient”, action = “Index” } ); Most Specific http://localhost/Patient/Index public ActionResult Index() {  IList<Patient> model = GetPatients(); http://localhost/Patient/ PatientController Least Specific return View(“Index”, model); } http://localhost/ Additional Info http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx http://www.asp.net/mvc/tutorials/asp-net-mvc-routing-overview-cs http://haacked.com/archive/2010/02/12/asp-net-mvc-2-optional-url-parameters.aspx
  • 8. User Interface  Consistency  Maintainability  Data Binding  Reliability  Security
  • 9. Web Forms ASP.NET MVC  <asp:TextBox />  Html.EditorFor(m => m.FirstName)  Date  Number (int, decimal, ...)  String  <asp:DropDownList />  Foreign Keys  Nullable<bool>  <asp:CheckBox />  Boolean
  • 10. Web Forms Ugly Themes Cluttered ASP.NET MVC
  • 11. Other HTML Helper methods  Html.TextBox(“FirstName”);  Html.DropDownList(“UidBloodType”);  Html.EditorFor( m => m.FirstName )  Strongly-Typed  Intellisense
  • 13. Matched on System.Type Name  DateTime.ascx for DateTime  Using UIHintAttribute  [UIHint(“SelectionElement”)] public int UidBloodType { get; set; } Brad Wilson – ASP.NET MVC 2 Templates (series) http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-1-introduction.html
  • 15. Web Forms ASP.NET MVC Patient model = service.GetPatient( id ); PatientViewModel viewModel = Mapper.Map<Patient, PatientViewModel>(model); viewModel.RaceCheckBoxes = GetRaceSelections(model.UidPatient); viewModel.BloodTypes = new SelectList(service.GetBloodTypes(), "UidBloodType", "BloodTypeDesc", model.UidBloodType); return View("Edit", viewModel);
  • 16. Web Forms 1. View Model 2. Data Binding 3. Server-Side Validation ASP.NET MVC
  • 17. T4 - Text Template Transformation Toolkit
  • 18. T4 Toolbox o http://t4toolbox.codeplex.com/  Microsoft SQL Server 2008 SDK  C:Program Files (x86)Microsoft SQL Server100SDKAssemblies ▪ Microsoft.SqlServer.ConnectionInfo.dll ▪ Microsoft.SqlServer.Management.Sdk.Sfc.dll ▪ Microsoft.SqlServer.Smo.dll
  • 19. Leave [Custom Tool] property empty for all files with .t4 extension.
  • 20. Model Metadata = Presentation + Validation
  • 21. Presentation  [DisplayName] and [Display].NET 4.0  [HiddenInput]  Validation  [StringLength]  [RegularExpression] Brad Wilson – ASP.NET MVC 2 Templates (series) http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmetadata.html http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-4-custom-object-templates.html
  • 22.
  • 23. ASP.NET MVC 3  Built-in support for Validation Summary with jQuery http://geekswithblogs.net/stun/archive/2011/01/28/aspnet-mvc-3-client-side- validation-summary-with-jquery-validation-unobtrusive-javascript.aspx
  • 24. WebForms ASP.NET MVC Web Controls  Html.EditorFor() Themes / Skins  Use View Templates Validation  Attributes from Data Annotations View Models Data Binding  and ViewData[“PropertyName”] = value;
  • 25.
  • 26. Thank you!  Soe Tun http://geekswithblogs.net/stun Twitter: @SoeLinn Email: soelinn@gmail.com
  • 27. Phil Haack Custom Validation Attributes http://haacked.com/archive/2009/11/19/aspnetmvc2-custom-validation.aspx  Kazi Manzur Post-Redirect-Get (PRG) Pattern http://weblogs.asp.net/rashid/archive/2009/04/01/asp-net-mvc-best-practices-part-1.aspx http://weblogs.asp.net/rashid/archive/2009/04/03/asp-net-mvc-best-practices-part-2.aspx  Martijn Boland Paging with ASP.NET MVC http://blogs.taiga.nl/martijn/2008/08/27/paging-with-aspnet-mvc/ Note: I modified his code a little bit in my demo project.