The top 10 mistakes when using AJAX

Here is an interesting list of the top 10 things people do wrong when using AJAX.

  1. Don’t use AJAX to update the complete page by putting everything in a UpdatePanel. You want to save time and traffic when running the web page. Never update parts of the web site that can be changed using JavaScript and DHTML (DOM).
  2. Have in mind that there are a couple of visitors that have JavaScript disabled or using a web browser with an older or less JavaScript implementation like the most mobile devices have. What does your visitor see if everything is disabled? I don’t recommend to have the full web site available as a JavaScript disabled version!
  3. Cache the same requests on client-side web browser or implement any caching on the web server. The most used scenarios like AutoComplete or DropDown fields are filled everytime the same. A wrong written AutoComplete can slow down your web server (database server) because there more requests done than the version before using PostBacks. Think of pressing F5 (reload) all the time with your old web site. If you have cascading DropDown you can save more traffic/requests!
  4. Don’t run concurrent or long running AJAX requests when using CSS or JavaScript to change the UI. There are only two concurrent http connections possible with all common web browsers (I know you can change this, but the default behavior is set to two). If there are running to many AJAX requests running loading of images will be slow down.
  5. Use everytime the asynchrouns invoke of the send method of XMLHttpRequest. There is no issue where you want to use the synchronous one. Your web browser will not be forozen when having network problems or slow connections.
  6. Try your web application using a very slow internet connection. Try it again using a TCP/IP connection with a very high latency for each paket.
  7. Is your web application running as a desktop replacement? Have a look at the memory usage of common web browsers if you run your application one hour, two hours or couple of days. Not everybody has a development machine like yours!
  8. Check the http status code you will get back from XMLHttpRequest. There are a couple of common network errors like DNS not available, http server error 500. Did you ever checked for the status code which tells you if your web browser is in offline mode?
  9. Try to disable the XMLHttpRequest object! With IE7 you can use the native object instead of the ActiveX object, but you can still disable the native object, too.
  10. Check your AJAX requests for security issues! Did you simple open all your data access layers? Make use of FormsAuthentication and PrincipalPermissions on ASP.NET. Can anybody create requests (not only by clicking on a link)?

Getting IE To Print Backgrounds And Cell Colors

I was having a small problem getting some reports to print the way I wanted.

I turns out that to get the table cells colored backgrounds to print, click on the browser’s Tools menu. Select Internet Options, then click on the Advanced tab. Scroll down to find the Printing heading and check the box called Print Background Colors and Images. This setting affects both page backgrounds and table cell backgrounds.

5 Rarely used XHTML elements

This article is pretty interesting, as it discusses 5 xhtml elements that most people don’t know about or use.

1) OptGroup

  Surrey Kent   Orkney 

  C# C++ Java   ASP.NET PHP 

2) label (click the “Full Name”)

Full Name Gender:  Male Female


3) fieldset/legend

CommentsCP is a good place to publish XHTML related articles. can search
Personal InformationFull Name Gender:  Male Female

4) col/colgroup (notice the control over col widths)

1   2
3   4


5) Acronym (mouse over xhtml)

CP is a good place to publish XHTML related articles.


These are not widely known but very useful.

Fixing Left Column Problem With dasBlog Essence Theme

I got a response back from Jelle Druyts regarding the problem where the left column falls off the page if you narrow the window enough.

He was kind enough to respond with his CSS changes:

/*—– Content Styles —–*/

#content {
        margin-top: 10px;
        position: relative;
        top: 0px;

#bodyContainer {
        margin-left: 220px;

/* Exceptions for Print */
@media print {
        #bodyContainer {
                width: 100%;
                margin-left: 0px;

(…A little later…)

pre {
        overflow-x: scroll;

(…A little later…)

#metaContainer {
        border: 1px dashed #d0d0d0;
        background-color: #f0f0f0;
        color: #505050;
        font-size: smaller;
        width: 210px;
        position: absolute;
        top: 0px;

Once you apply these to the dasBlog.css file in the Essence theme package, the left column will remain in place!  Excellent!