Updatepanel best practices
This presentation is the property of its rightful owner.
Sponsored Links
1 / 9

UpdatePanel Best Practices PowerPoint PPT Presentation


  • 99 Views
  • Uploaded on
  • Presentation posted in: General

UpdatePanel Best Practices. Normal Page life cycle. browser. Control tree creation. ViewState deserialization. DataBinding. HTML generation. HTTP GET. HTML. Page. init. load. render. Postback Page life cycle. Browser. ___doPostBack. Control tree creation.

Download Presentation

UpdatePanel Best Practices

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Updatepanel best practices

UpdatePanel Best Practices


Normal page life cycle

Normal Page life cycle

browser

  • Control treecreation

  • ViewStatedeserialization

  • DataBinding

  • HTML generation

HTTP GET

HTML

Page

init

load

render


Postback page life cycle

Postback Page life cycle

Browser

___doPostBack

  • Control treecreation

  • ViewStatedeserialization

  • ProcessPostData

    • IPostBackDataHandler

  • DataBinding

  • ProcessPostData

    • IPostBackEventHandler

  • HTML generation

__EVENTTARGET  ClientID of postback control__EVENTARGUMENT  Optional argument

HTTP POST

HTML

Page

init

load

render


Updatepanel best practices

Source : http://blogs.developpeur.org/cyril/archive/2006/09/14/Cycle-de-vie-d-une-page-ASP-net.aspx


Updatepanel

UpdatePanel

  • Partial-page rendering in a box

    • Clean round trips to server and flicker-free updates

    • Requires no knowledge of JavaScript or AJAX

  • Use XMLHttpRequest

    • AJAX (Asynchronous JavaScript And XML)


Asyncpostback page life cycle

AsyncPostback Page life cycle

Browser

___doPostBack

MS Ajax __doPostBack

HTTP POST

XMLHttpRequest

Partial HTML

HTML

Page

init

load

render

Ms Ajax Render


Best practices

Best Practices

  • Use triggers

    • AsyncPostBackTriger

    • PostbackTrigger

  • Use SriptManager.IsInAsyncPostback

  • Use UpdateMode.Conditional

    • Default value isAllways

  • Call .Update() method

  • ReduceUpdatePanel size

    • 2 smallUpdatePanelisbetterthan a big one

  • Use ScriptManager in MasterPage

    • Use ScriptManagerProxy in the content Page


Pros cons

Pros & Cons

  • Pros

    • Veryeasy to use

    • Postbackphilosophy

      • No new concept to understand

    • No JavaScript

  • Cons

    • No JavaScript

    • Expensive

      • Full Postback

      • Large network exchange

    • Client Performance problem


Alternative

Alternative

  • JQuery

    • Framework for JavaScript developper

    • Easy DOM manipulation

    • www.jquery.com

Client / Browser

Server

MyPage.aspx

Layout / HTML

HTML

JavaScript

MyDataservice.svc

Data / JSON

  • DataService

    • SOA approch

    • ASP.net as a service

    • Pure JavaScript


  • Login