CQWP showing incorrect URLs to items

Markus Kolbeck
Markus' Blog
Published in
1 min readSep 30, 2013

Current Situation

A CQWP (Content Query Web Part) was programmatically added to a SharePoint Web Part Page.

The CQWP queries all documents from all libraries and displays it with a custom item style.

Problem

All items, i.e. documents, were displayed correctly. However, the link to the item was not correct. When clicking on that link the item’s properties would be displayed rather than opening the document in the client application.

Something like:

http:///sites//_layouts/CopyUtil.aspx?Use=id&Action=dispform&ItemId=1&&WebId=&SiteId=&Zone=0&Source=

Strangely, the dialogue from Office (“Open Document”: You are about to open … Would you like to open read only or edit …) was displayed.

Solution

When adding the CQWP make sure that the following property for the Web Part is set to false:

<property name=”UseCopyUtil” type=”bool”>False</property>

or programmatically:

ContentByQueryWebPart newWP = new ContentByQueryWebPart()
{

UseCopyUtil = false,

};

#sharepoint

--

--