The Engage Weblog

Using ASP.NET AJAX UpdatePanels in DotNetNuke

by Brian Dukes on Monday, February 26, 2007 11:50 AM

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.

Blogs Parent Separator Brian Dukes
Author
Brian Dukes

Brian Dukes has been working with Engage professionally since 2006, but has been writing code since around 1998. Brian is very passionate about writing code that is easily maintainable, and helping others to do the same. He has been a leader in the DotNetNuke Community, and can often be found speaking at conferences and helping others on twitter, github, and stackoverflow. DNN recognized his community efforts by awarding him the DNN MVP in 2012. Outside of work, Brian spends time with his family, serves Jesus at City Lights Church, as well as supporting social justice, fair trade, local, seasonable food, and international adoption.