Since the Microsoft Ajax was released, a lot of ASP.Net developers began using UpdatePanel for streamlining their applications and indeed the WWW starts to seem a little bit more fluent nowadays.

Unfortunately UpdatePanel is not used always in the right places or in the right way, some applications begin to feel clumsy and slow and you’re thinking WHY?! Below I compiled a small list of tips and tricks on how and where to use an UpdatePanel.

  • In web.config use this:

<system.web.extensions>
    <scripting>
        <scriptResourceHandler enableCompression=“true” enableCaching=“true”/>
    </scripting>
</system.web.extensions>
This will improve script handling by adding compression and caching

  • When deploying to a live server use: <compilation debug=“false”> 
  • Don’t use AJAX to update the complete page by putting everything in a UpdatePanel. You want to save time and raffic when running the web page. Never update parts of the web site that can be changed using JavaScript and DHTML (DOM).
  • 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!
  • Cache the same requests on client-side web browser or implement any caching on the web server.
  • Remember that the page lifecycle is the same also during an asyncronous postback. That means that the Page_Load for example is executed also during an asyncronous postback. The IsPostback will be true in an asyncronous postback also.
  • Set the UpdateMode to “conditional” in the update panel

There are more,  feel free to add your own

One Response to “UpdatePanel - tips and advices”

  1. erickia says:

    Great blog…keep your good work for your blog and i hope can see more cool news soon, cya

Leave a Reply