Once More Into the UpdatePanel

Tags: AJAX, UpdatePanel

In the June issue of MSDN Magazine Jeff Prosise writes a nice article about the UpdatePanel. Even if you have already had a look under the hood of the UpdatePanel the article is still worth reading.

He starts out by stating what many of us have already said for some time - the UpdatePanel is not AJAX but a traditional PostBack channelled through an XmlHttpRequest. It's one thing to have written about this on this blog, it's another thing to see it written in MSDN Magazine. It's not that Microsoft has done a bad job with the UpdatePanel. There are a lot of data that need to be kept synchronized to make use of the Viewstate. Furthermore the developers at Microsoft had to create something that can be used by novice users with no knowledge (and maybe some fear) of JavaScript. One of the main platforms for ASP.NET applications are in companies' intranet applications, where bandwidth is less of an issue, so the UpdatePanel will work well here and problems will not show up before the application is ported to a webserver which receives many many hits.

In this day and age few users still use narrowband connections (and they need to get with the program). The real problem comes from overloading a server with constant connections to fetch, update or just verify data. Because of the nature of HTTP requests pages have to be created from scratch for every little tiny request, which can lead to an enormous amount of traffic if your application needs to communicate with the server often.

Jeff Prosise spends some time in his article to show how users can fetch data from a web service so it is not necessary to go through the whole page life cycle to handle what may be a very small amount of data on a large page. While web services and also the page methods he describes are interesting, I tend to prefer developing controls with a supporting handler that can receive or serve data outside the page life cycle. I prefer using the handler approach as it ensures that any user cookies are sent along with the request, but I will have a look at the page methods.

One thing I think one can safely deduce from the AJAX craze, namely that the Viewstate approach is heading towards an end. It's not that the idea of Viewstate (or state management) is bad - I think it's great - but it's to inflexible to be of use for developers who want to access their page state outside the page life cycle.

Before I stray to far I should return to the initial recommendation and encourage everyone to read the article.

Add a Comment

Search

Latest Tweets

Blogged: Creating DTOs at Runtime http://t.co/2VybUNua

@randompunter GetCustomAttributesData provides enough data to safely construct a CustomAttributeBuilder.

@randompunter Found workaround. Custom attributes provide data to create copy instance.

@randompunter I know. I was hoping there was some way of finding requirements when building types at runtime.

Problem setting attribute on runtime type where attribute uses #CodeContracts. Any way to find contract requirements through reflection?