Making The Content Query Web Part AJAX Enabled

For a WCM project that I’m working on I’ve been looking at the new and improved Content Query Web Part in SharePoint 2010. I stumbled across some properties in the .webpart file of a CQWP that seemed to indicate it was possible to enable AJAX for the web part… and so it proved to be!

If you’ve used the List View Web Part in SP2010 to drop a view of a library or list onto a page you may have noticed that there’s a category in the web part properties for ‘AJAX Options’:


Enabling these options for your List View Web Part allows for the asynchronous update of the content being displayed – which is fantastic.  So how do we get the Content Query Web Part to behave in a similar way?

Looking in the web part properties pane of the CQWP you will notice that the ‘AJAX Options’ section is missing. The options however are available if you export the web part and manually edit the .webpart file. [Looking on MSDN you can see that the AJAX options seem to be available because the CQWP inherits from the Data Form Web Part]


From my understanding the properties map as per below:

CQWP .webpart Property LVWP Property
InitialAsyncDataFetch Enable Asynchronous Load
AsyncRefresh Enable Asynchronous Update
ManualRefresh Show Manual Refresh Button
AutoRefresh Enable Asynchronous Automatic Refresh
AutoRefreshInterveral Automatic Refresh Interval (seconds)

By setting AsyncRefresh and AutoRefresh to True I was able to see the contents of my content query web part update themselves without a page refresh. Awesome! I need to do a lot more investigation about how/ if this is usable in a real world situation but it’s a pretty cool start.

And now for a disclaimer! It’s highly likely that these options are not presented to the user for a reason. My guess would be that it’s because of a performance hit. So by following the instructions in this post you’ll need to consider what impact this has on the performance of your solution.

share and enjoy
  • Print
  • Twitter
  • Digg
  • StumbleUpon
  • Yahoo! Buzz
  • Google Bookmarks
  • Facebook

3 comments to Making The Content Query Web Part AJAX Enabled

  • Nice tip! Did you end up using this in a real world solution and/or find any drawbacks to enabling this?

    • Cheers. I’ve actually set it up on a live site just this week and am monitoring how it’s going now. So far it seems to be working as you’d expect with no unexpected side effects.

      I’ve been told that the update panel technique that MS use for their AJAX stuff (inc. on XLVs) is quite inefficient – and so performance is something to keep an eye with older browsers etc.

      Also, obv. depends on the situation – I think that for most scenarios an autorefresh is probably not needed unless you have users sitting on a page for great lengths of time. Providing a link (via) the XSL for the manual refresh button is probably a good half-way point. (I’ve done this for an XLV with custom XSL, but not for a CQWP yet).

  • Venkat

    Hi,I have a page in which I have added a list as webpart (SP 2013). In the webpart properties,. I have enabled the “Enable Asynchronous Update”, “show manual refresh button”,”Enable Asynchronous Automatic refresh” and the time is set to 30.

    This works fine. Issue is when 2 full control users login and view the page. When one of the user is editing the list view, and other user is just viewing the page. After 30 seconds, the view automatically gets changed to edit mode as like the other user.

    Have you come across this issue? Any solutions to fix this?

Leave a Reply to Venkat Cancel reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>