ContentBySearchWebPart class

SharePoint 2013

The ContentBySearchWebPart is a Web Part introduced in SharePoint Server 2013 that can display dynamic content that was previously crawled and added to the search index.

Each Web Part instance is associated with a search query and shows the results for that particular search query. When users browse to a page that contains a ContentBySearchWebPart, the search query is automatically issued and the corresponding search results are returned from the search index.

You can use display templates, which are snippets of HTML and JavaScript, to change how search results appear on the page. Display templates render information returned by SharePoint; the information is inserted into the page in JSON format.

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.Office.Server.Search.WebControls.ScriptWebPart
                Microsoft.Office.Server.Search.WebControls.DisplayScriptWebPart
                  Microsoft.Office.Server.Search.WebControls.ResultScriptWebPart
                    Microsoft.Office.Server.Search.WebControls.ContentBySearchWebPart
                      

Namespace:  Microsoft.Office.Server.Search.WebControls
Assembly:  Microsoft.Office.Server.Search (in Microsoft.Office.Server.Search.dll)

[ScriptDescriptorComponentTypeAttribute("Srch.ContentBySearch")]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public class ContentBySearchWebPart : ResultScriptWebPart

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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.Office.Server.Search.WebControls.ScriptWebPart
                Microsoft.Office.Server.Search.WebControls.DisplayScriptWebPart
                  Microsoft.Office.Server.Search.WebControls.ResultScriptWebPart
                    Microsoft.Office.Server.Search.WebControls.ContentBySearchWebPart
                      Microsoft.Office.Server.Search.WebControls.CatalogItemReuseWebPart

Community Additions

ADD
Show:
© 2014 Microsoft