10.4. Practical Ajax Tips

Remember these tips to help you create better user experiences:

  • Since the content for the UpdateProgress panels is only visible during an Ajax page update, you'll find that it's hard to design its contents. You only see the content for a few seconds or less and only after you cause a postback to the server. To make it easier to design the UpdateProgress panels, you should first design the message outside of the UpdateProgress panel. For example, in the exercise from this chapter, you should move the <div id="PleaseWait"> outside any other controls so it's always visible. You can then change the HTML and the CSS for the <div> until it looks exactly right. Then you can move the <div> back into the UpdateProgress panel so it's shown only during a partial page update.

  • Whenever you are using an UpdatePanel, consider adding an associated UpdateProgress control as well. Even if you don't see the need because the UpdatePanel refreshes really fast, it may be worth adding the UpdateProgress for people on slow computers or slow networks. Or better yet: add an UpdateProgress to the master page in a convenient and visible area of the page (in the Footer region for example). Don't set AssociatedUpdatePanelID to anything so the progress panel will show on any Ajax callback. This way, you don't need lots of different waiting indicators in different areas of the page.

  • Don't overuse UpdatePanel controls. In many situations, the perceived performance of an application increases ...

Get Beginning ASP.NET 3.5: In C# and VB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.