0
votes

I've got some code that loops through webparts on a page looking for an Advanced Search box in order to change some properties. Very simple stuff, essentially:

if (webpart is AdvancedSearchBox) {
  do stuff;
}

I have seen this class referenced on blogs in code pertaining to SharePoint 2010 (http://weblogs.asp.net/spano/archive/2012/07/20/customizing-a-sharepoint-2010-search-center.aspx for example), but I can't for the life of me find the class itself. The only official reference I can find refers to 2007 - http://msdn.microsoft.com/en-us/library/microsoft.office.server.search.webcontrols.advancedsearchbox(v=office.12).aspx, and no matter what assemblies I include, Intellisense just does not recognise it.

I hope I'm missing something obvious - does anyone know where this class is, or whether it's deprecated? The web part itself is already in use in our solution, so it definitely exists somewhere. Many thanks in advance!

1

1 Answers

0
votes

Solved it. What was needed in order to use the class was all of the following:

  • Microsoft.office.server.search.dll added as reference
  • Both of the following using directives:
    • using Microsoft.Office.Server.Search
    • using Microsoft.Office.Server.Search.WebControls
  • And a Visual Studio restart

I think it was the last point that stumped me - until the restart, VS wasn't recognising the class name at all.

With thanks to Pradip T on Technet. http://social.technet.microsoft.com/Forums/sharepoint/en-US/295b0962-0cdf-41e4-96c9-d07876982c4d/sharepoint-2010-advancedsearchbox-class-or-similar