Monday, October 26, 2009

Chapter 6-Lesson 1

  • In Client-Server model, a thin client is one where most processing is done on server, while a thick client is one where most processing is done on the client.
  • Every ASP.NET AJAX page should contain one ScriptManager control.
  • This control is reponsible for generating Microsoft AJAX Library code for the client.
  • If a page that uses AJAX controls, contains a ScriptManager, it would conflict if the page uses a masterpage that also uses a ScriptManager. To overcome this, use ScriptManagerProxy control inside the child page.
  • Similarly use ScriptManagerProxy for User Controls that use AJAX, so that they may not conflict with any ScriptManager that is present in the page that employs the User Control.
  • UpdatePanel control defines areas of the page that are able to send Asynchronous Postbacks to the server.
  • Setting UpdatePanel.UpdateMode property to Always denotes that its contents will be updated on every Postback (partial or complete) that occurs from within the page.
  • We may set the UpdatePanel.UpdateMode property to Conditional so that it updates its contents upon certain conditions, e.g. in case of nested UpdatePanels as described in Page 334.
  • Another way is to call the Update( ) method on the UpdatePanel from server-side code. (This might be done during another Async Postback)
  • By default Nested UpdatePanel (whose UpdateMode is set to Conditional) will not cause update to the parent UpdatePanel. To enable this, set ChildrenAsTriggers property of the outer UpdatePanel to true.
  • We may assign different trigger controls to an UpdatePanel using either markup () or using properties pane.
  • If an error occurs during an Async Postback, it may be handled using the AsyncPostbackError event of the ScriptManager control.
  • All the content is place inside ContentTemplate control within an UpdatePanel.
  • UpdateProgress control present inside an UpdatePanel ContentTemplate would render as a hidden div in the resulting HTML.
  • By default the UpdateProgress control shows up on every Async Postback. To associate it with a particular UpdatePanel, set its AssociatedUpdatePanelId property.
  • We may also change the DisplayAfter property to number of milliseconds for the UpdateProgress after which it would show up following the Async Postback. (This defaults to half second)
  • PageRequestManager class contains abortPostBack( ) method which may be used to cancel a partial postback if called from a control within UpdateProgress control.
  • Timer control is used to execute certain code (at Tick event) on the client on periodic basis. If it is placed inside an UpdatePanel, the TimeInterval property will be reset after the UpdatePanel postback is complete. If placed outside, it will be reset as soon as the event is fired.
  • In case a postback is in progress if the Tick event fires, the first postback is cancelled.
  • The Timer control can also be used from outside an UpdatePanel to trigger it for Async Postback.

No comments:

Post a Comment