1 / 9

UpdatePanel Best Practices

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.

evers
Télécharger la présentation

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. UpdatePanel Best Practices

  2. Normal Page life cycle browser • Control treecreation • ViewStatedeserialization • DataBinding • HTML generation HTTP GET HTML Page init load render

  3. 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

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

  5. 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)

  6. AsyncPostback Page life cycle Browser ___doPostBack MS Ajax __doPostBack HTTP POST XMLHttpRequest Partial HTML HTML Page init load render Ms Ajax Render

  7. 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

  8. 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

  9. 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

More Related