Menu:

Recent Entries

Categories

Archives

Links

Blogs
- Dflying's Night
- David's Untitled Life
- Dflying's Blog in Chinese

This blog is hosted by DreamHost!

Syndicate

RSS 0.90
RSS 1.0
RSS 2.0
Atom 0.3

Atlas UpdatePanel Tips and FAQs

Dflying | 31 March, 2006 06:28

The first Atlas control a developer may use should be the UpdatePanel, which is really powerful and easy to use. It provides us a closer view of Atlas.

I’ve posted a simple introduction (http://dflying.dflying.net/1/archive/96_introduction_to_atlas_updatepanel.html) to UpdatePanel here and got a lot of questions in the Chinese community. So I think it is better to summarize this kind of questions and answers to a single post about UpdatePanel tips.


The first important thing I want to mention is the useful site http://atlas.asp.net/, which is the home of Atlas. Since Atlas is really a new technology and still in CTP now, it changes a lot even within one month and lack of resources. So for an Atlas developer, you should always keep an eye on http://atlas.asp.net/. For a beginner, you may check out the documents at http://atlas.asp.net/docs. But do remember that is not completed yet. Still, you should also visit sites below, which are the personal sites/blogs of Atlas key persons.

Here are the tips on Atlas UpdatePanel server control:

  1. DO set the EnablePartialUpdates to true in your ScriptManager. I’ve seen lots of people complain to me that their UpdatePanels do not work in the AJAX way just because they did not set this property.
  2. Make the control which triggers your UpdatePanel runs as a server control by adding runat=”Server”. For the triggers of UpdatePanel, either ControlValueTrigger or ControlEventTrigger, it triggers the PostBack only when a server property changes or a server event fired.
  3. Distinguish the two modes of updating: Always and Conditional. Refer to http://dflying.dflying.net/1/archive/96_introduction_to_atlas_updatepanel.html for differences between them. And you should always properly set it to avoid updating panel which do not need to be updated.
  4. It is not the best choice for one who wants to build a brand new AJAX enabled application to use UpdatePanel only, though it is really very simple. UpdatePanel just updates ALL the controls in its ContentTemplate from server, which may be very low efficient. For example, an UpdatePanel contains a TreeView which contains lots of notes. Then, I just want to add a new note but the whole tree is refreshed, which takes much more time than just save the new note to backend and update the existing tree. In these cases, it is better to use some more advanced Atlas features such as Atlas client side controls.
  5. You have to make your UpdatePanel reachable when the page's InitComplete event was raised. That is, you can not place one UpdatePanel in the HeaderTemplate of a DataList Server control, for the content of HeaderTemplate is rendered in databinding, after the page’s Init step.
  6. You can use the Atlas client side scripts on any platform you like such as ASP.NET 1.1, pure HTML, even PHP or something else but the Atlas server controls are only available for ASP.NET 2.0. Atlas client side scripts are actually some kinds of well formatted JavaScript files which are of course server side technologies independent. But when using in platforms other than ASP.NET 2.0, you should be responsible for linking the essential JavaScript files manually to your page for you can not use the ScriptManager server control there.
  7. When using some 3rd part components, you should pay more attention to make it work. Building JavaScript frameworks are much more difficult than others. There are still many capability issues in current implementation. Lets’ try to expect it better or just fix the bugs by ourselves.

Also it is a good idea to add an UpdateProgress Atlas server control to your page to show user what you are doing. Here are some tips about UpdateProgress control:

  1. You should add ONE and ONLY ONE UpdateProgress controls to your page. The UpdateProgress should be a global control just like the progress bar of the browser. Imaging if Gmail has two ‘Loading’ icons when doing AJAX requests, it could confuse user a lot.
  2. There is a ‘magic ID’ for UpdateProgress template: abortButton. You may provide a Button or LinkButton with the ID abortButton so the user can cancel the AJAX request if they wish by clicking this. But this is a bad design and should be replaced in later release by a <CancelTemplate> or something else. Anyway, in current version, remember the ID abortButton.

Any questions please commenting down.

Posted in Atlas. Comment: (0). Trackbacks:(533). Permalink
«Next post | Previous post»

Referers

Comments

Leave a Reply

Auth Image