Engage on Facebook Engage on Twitter Engage on LinkedIn Engage on GitHub components notes mobile card heart 2 infinite mirror 2 pricing

Using ASP.NET AJAX UpdatePanels in DotNetNuke

By Brian Dukes

Since the 1.0 release of ASP.NET AJAX Extensions, we've been making use of the new functionality offered us through AJAX, both from the core extensions and through the AjaxControlToolkit.  However, we've run into a road block a number of times when we're tried to use the new UpdatePanel control to add some AJAX responsiveness into our web pages.  In short, we hadn't ever gotten it to work.

Recently, some clients were pressing us for some functionality that required UpdatePanels (or diving much deeper than we liked into JavaScript), so after another failed attempt at partial rendering, I handed the project over to a colleague to see if he might have any better luck.  Fortunately, he was able to search out the information we needed.  I had seen Jon Henning's blog post about integrating UpdatePanels into DNN, but it was rather old, so I didn't pay a whole lot of attention to it.  As soon as Chris showed me his solution, I realized that I had been staring at it the whole time.  The DotNetNuke web.config defaults the mode attribute on the xhtmlConformance node to "Legacy," which isn't compatible with UpdatePanels.  It needs to be set to "Transitional."

One other symptom of this was that, not only would the UpdatePanel not do it's automagic AJAXifying, it didn't set itself up in the javascript, either.  So, code like what I found at http://smarx.com/posts/why-the-updateprogress-wont-display.aspx, which is supposed to allow you to tie into a control's postback to perform some action, wasn't working.  There was no PageRequestManager being created, so even basic JavaScript wasn't working.

So, if your UpdatePanels don't update without a full postback, or your JavaScript doesn't initialize the PageRequestManager or other expected objects, check your web.config's xhtmlConformance.  Scott Guthrie also addresses this in one of his blog posts.

Planning a DNN upgrade? Download our guide