Docstoc

FT03- Tips and Tricks Tips and Tricks for Making Web

Document Sample
FT03- Tips and Tricks Tips and Tricks for Making Web Powered By Docstoc
					         Tips and Tricks for
      Making Web Forms Shine
      with Microsoft ASP.NET 4
Jon Galloway
Community PM – ASP.NET
jon.galloway@microsoft.com
                                  The Objective

Objective: Fix this old and busted site
            Gear Up with ASP.NET 4 Tools

•   Cleaner HTML (+8 dexterity, +10 charisma)
•   Enable Dynamic Data (+9 speed, +7 agility)
•   Routing (+9 agility)
•   Easy AJAX (+8 speed)
•   Simple Charts (+7 boss points)
                     The Plan

1.   Data Makeover
2.   Routing
3.   HTML Cleanup
4.   AJAX
5.   Charts
                        Data Makeover

• Add an Entity Framework model
• Enable Dynamic Data
• Add filtering with Query Extender
                                   Data Makeover

Enable Dynamic Data
GridView.EnableDynamicData(typeof(Product))

One line of code turns on many Dynamic Data features:
• Automatic validation
• Support for Data Annotations on objects to control
  validation and display properties
• Support for field templates for customizing UI
  behavior based on data type
                                               Routing

• Turn this:
  /directory/ProductList.aspx?CategoryID=205
  &LanguageID=1033

  Into this:
  /en-US/products/beverages
                                    HTML Cleanup

• Step 0: Why are we doing this?
  – Much easier to do CSS styling
  – Simpler AJAX
  – Easier to work with
  – More efficient
                                HTML Cleanup

[DEMO]
• Start with ASP.NET 4 default style and Master
  Page
• Set controlRenderingCompatibilityVersion to 4.0
• Disable ViewState at page level
• Demonstrate predictable ClientID
  – Styling
  – AJAX (next)
• Use CSS for simple mobile support
                                             AJAX

• Use CDN for AJAX Scripts
• Use jQuery (with predictable ClientID’s)
• Using new jQuery templating (just
  announced!)
Charting

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:8
posted:6/8/2013
language:English
pages:13