Click to Rate and Give Feedback
Community Content
In this section
Statistics Annotations (8)
Collapse All/Expand All Collapse All
This page is specific to
The 2007 product release

Other versions are also available for the following:
ContentByQueryWebPart Class (Microsoft.SharePoint.Publishing.WebControls)
A Web Part object that is used to retrieve dynamic information.

This class is not CLS-compliant.  

Namespace: Microsoft.SharePoint.Publishing.WebControls
Assembly: Microsoft.SharePoint.Publishing (in microsoft.sharepoint.publishing.dll)
Visual Basic (Declaration)
<XmlRootAttribute(Namespace:="urn:schemas-microsoft-com:ContentByQueryWebPart")> _
<CLSCompliantAttribute(False)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
Public Class ContentByQueryWebPart
    Inherits CmsDataFormWebPart
    Implements INamingContainer, IWebPartVariationUpdate
Visual Basic (Usage)
Dim instance As ContentByQueryWebPart
C#
[XmlRootAttribute(Namespace="urn:schemas-microsoft-com:ContentByQueryWebPart")] 
[CLSCompliantAttribute(false)] 
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public class ContentByQueryWebPart : CmsDataFormWebPart, INamingContainer, IWebPartVariationUpdate

A ContentByQueryWebPart object uses the CrossListQueryCache object to retrieve data. The data retrieved is cleaned and then sent to the XSLT engine. The XSLT engine uses the defaultHeader.xsl, defaultItem.xsl, and defaultMain.xsl files to translate the data into HTML markup that is presented to the user. You can customize the HTML output of the ContentByQueryWebPart by using the XSL transform. The DataProcessDelegate allows you to retrieve data to be modified before it is sent to the XSLT engine. If the P:Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.Data property of this Web Part is specified, the data is not retrieved and the specified data is used instead. The ContentByQueryWebPart object derives from the CmsDataFormWebPart object that caches XSLT transforms.

System.Object
   System.Web.UI.Control
     System.Web.UI.WebControls.WebControl
       System.Web.UI.WebControls.Panel
         System.Web.UI.WebControls.WebParts.Part
           System.Web.UI.WebControls.WebParts.WebPart
             Microsoft.SharePoint.WebPartPages.WebPart
               Microsoft.SharePoint.WebPartPages.BaseXsltDataWebPart
                 Microsoft.SharePoint.WebPartPages.DataFormWebPart
                   Microsoft.SharePoint.Publishing.WebControls.CmsDataFormWebPart
                    Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart
                       Microsoft.SharePoint.Portal.WebControls.ListingSummary
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Non CLS-compliant class      Reza Alirezaei - MVP   |   Edit   |   Show History

ContentByQueryWebPart is marked as a non CLS-compliant class which means this class or any derived type may not be interoperable with a wide range of .Net supported programming languages. Generally, C# complier does not check for CLS compliance of your code and you have to explicitly instruct it to do so. This class for whatever reason is not decorated to be CLS-compliant and it should be used with extra caution in regards to interoperability.

[CLSCompliant(false)]
public class ContentByQueryWebPart : CmsDataFormWebPart
{
.....
}

HTH,

Reza Alirezaei, MVP
Blog: http://blogs.devhorizon.com/reza

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker