Real-World AJAX with ASP.NET

  • 2,283 views
Uploaded on

Dive deep into the new ASP.NET AJAX features and capabilities including patterns covering search optimization, user interface and usability, intuitive navigation, and much more.

Dive deep into the new ASP.NET AJAX features and capabilities including patterns covering search optimization, user interface and usability, intuitive navigation, and much more.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,283
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
38
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Quick overview of ASP.NET Ajax Ajax deep-dive Cover some key real-world problems Discuss solutions, patterns, opportunities Lots of demos And more of ASP.NET Ajax
  • 2. Partial rendering Update a portion of the page without writing any script Ajax Control Toolkit Open source project at http://www.codeplex.com/AtlasControlToolkit Lots of Ajax-enabled server controls Web services Exposing web services as JSON services Super simple access via script proxies and networking stack Script Framework (MicrosoftAjax.js) Type system, and general framework for creating Ajax apps
  • 3. Ajax has become mainstream Users have come to expect it However, subtle use of Ajax is usually effective Don‟t have to go overboard with flashy apps It is about creating better user experiences Fluid user interface matching user task flows Rich data visualization Intuitive data entry It is not just about updating page contents by issuing xmlhttp requests
  • 4. Script complexity Indexability and SEO Navigation and bookmarkability Increasing user expectations Diagnostics/Tracing/Monitoring Performance Accessibility Browser API inconsistencies …
  • 5. Increasing complexity with increased Ajax features Use appropriate framework features Script components, encapsulation of logic OOP Separation of content, presentation, and logic Partial rendering in ASP.NET Behaviors in ASP.NET Ajax Re-use and encapsulation mechanism Represent script logic that you attach to markup Usable in a variety of scenarios Enable better designer/developer workflow
  • 6. Ajax updates don‟t affect the browser history Breaks the back button Might also break bookmarkability It is an opportunity! You have a clean slate Add your own history points to create a better navigation model than regular post-backs ASP.NET Ajax History Feature Very simple API to abstract browser “nuances” Call addHistoryState() Handle the navigated event to detect state changes Updates URL fragment to also provide bookmarkability
  • 7. Preserving indexability is a must for most sites Relies on presence of static data within pages Ajax apps often fetch data dynamically App structure and logic isn‟t useful for searching An alternate Ajax pattern Embed data statically within the page Make every page of data independently discoverable via sitemaps Script consumes data and creates interactive presentation Script uses xmlhttp to implement paging as well
  • 8. <script> document.write(„<div style=“display: none”>‟); </script> Script-enabled View Search Engine Browser View <div id=“photoList”> <div> <div id=“photoList”>none”> <div style=“display: <h1 class=“title”>…</h1> <div id=“photoList”> <div> <img class=“photo” src=“…” alt=“…” /> … <h1 class=“title”>…</h1> </div> </div> </div> class=“photo” src=“…” <img </div> alt=“…” /> <div id=“mapFrame” /> <script> </div> <script> document.write(„</div>‟); </div> to create map // Script </script> <div id=“mapFrame” /> </script> <div id=“mapFrame” /> <script> // Script to create map </script>
  • 9. Increasing user expectations for functionality Ability to work with local files Expectations around faster applications Deeply integrating media experiences Using islands of Silverlight Can be used incrementally to light up existing Ajax apps Balancing reach and capabilities New capabilities to your application CLR-based execution, threads for background work Access to local storage and files Vector graphics, media
  • 10. ASP.NET Ajax http://ajax.asp.net Docs, how-to videos, forums etc. Ajax Control Toolkit http://www.codeplex.com/AtlasControlToolkit My Blog http://www.nikhilk.net Slides + Samples My Contact Form
  • 11. Prioritize creating better user experiences Think about where to apply Ajax in your applications Approach Ajax systematically Separate content and behavior Apply established patterns for addressing key Ajax challenges Leverage ASP.NET Ajax Solutions and framework for creating real-world Ajax apps
  • 12. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
  • 13. Ajax apps have a lot more happening on the client Tracking script execution in production Handling errors internally and logging them End-user shouldn‟t ever see script errors Other tracing and tracking scenarios
  • 14. Broad discussion topic with several facets Script downloading/bandwidth consumption Script execution time Perception – get some rendering quick … ScriptManager.LoadScriptsBeforeUI One upcoming ASP.NET Feature: Script combining Reduces the number of script downloads per page