Intro to ASP'Net ajax - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Intro to ASP'Net ajax

Description:

Scripts collection. Services collection. Update Panel ... Quickly and easily make a better UX. Extender available to create your own controls ... – PowerPoint PPT presentation

Number of Views:160
Avg rating:3.0/5.0
Slides: 16
Provided by: Tim8159
Category:
Tags: asp | ajax | collection | intro | net

less

Transcript and Presenter's Notes

Title: Intro to ASP'Net ajax


1
Intro to ASP.Net ajax
  • Tim Wingfield

2
Why AJAX?
  • Better User Experience
  • Browser standards getting better
  • Use XMLHttpRequest
  • Javascript
  • Update the DOM

3
Objectives
  • How to get started with ASP.Net AJAX
  • The Script Manager
  • Using an update panel for partial page rendering
  • Javascript callbacks
  • AJAX Control Toolkit

4
Getting Started
  • Download the libraries at http//ajax.asp.net
  • Run installation
  • In Visual Studio add a new ASP.Net AJAX Enabled
    Web Site

5
Script Manager
  • ltaspScriptManager ID"ScriptManager1"
    runat"server /gt
  • EnablePartialRendering default True
  • EnablePageMethods default False
  • AsyncPostBackTimeout default 90 seconds
  • AsyncPostBackErrorMessage
  • Scripts collection
  • Services collection

6
Update Panel
  • ltaspUpdatePanel ID"UpdatePanel1"
    runat"server"gt
  • ChildrenAsTriggers default True
  • UpdateMode default Always
  • RenderMode default Block

7
Update Panel Pros and Cons
  • Pros
  • Quick and Easy
  • Makes most ASP.Net controls AJAX enabled out of
    the box
  • Cons
  • Full page life-cycle every time
  • No default user feedback of async postback
  • Extra work for error handling

8
Update Progress Control
  • Add your own images and text
  • Attaches to one or more Update Panels

9
Page Request Manager
  • Sys.WebForms.PageRequestManager.getInstance()
  • Manages the partial-page updates of Update Panels
  • Partial Page Rendering must be true
  • One instance per page

10
Page Request Manager Client Events
  • initializeRequest
  • beginRequest
  • pageLoading
  • pageLoaded
  • endRequest

11
Javascript Callbacks
  • Use Web Services or Page Methods
  • JSON
  • Can return full objects

12
Callback Pros and Cons
  • Pros
  • Lightweight and quick
  • No page lifecycle involved
  • Reuse via web services
  • Cons
  • Heavy client script
  • More difficult debugging

13
AJAX Control Toolkit
  • Shared source project through Microsoft
  • 34 controls at the moment
  • Download and copy dll into project to use
  • Quickly and easily make a better UX
  • Extender available to create your own controls

14
Resources
  • Microsoft AJAX libraries ajax.asp.net
  • Toolkit asp.net/ajax/ajaxcontroltoolkit/
  • Scott Guthrie weblogs.asp.net/scottgu/
  • Matt Berseth mattberseth.com
  • David Hayden davidhayden.com/blog/dave/

15
Tim Wingfield
  • Email tim_at_timwingfield.com
  • Blog blog.timwingfield.com
Write a Comment
User Comments (0)
About PowerShow.com