we created a custom SeachCenter WebTemplate in VS and added several webparts through the onet.xml. We added some default webparts (e.g. SearchBoxEx) and some custom webparts which inherit from CoreResultsWebpart.
Inside the codebehind I need to access the results, so I tried to get the QueryManager-object by the following Code (simplified representation):
QueryManager queryManager = SharedQueryManager.GetInstance(Page, QueryNumber).QueryManager;
if(queryManager.Count > 0)
{
LocationList locationList = queryManager[i];
XmlDocument resultsDoc = queryManager.GetResults(locationList);
//Do stuff...
}
My Problem is, that the count of the Query Manager is 0. For other custom Webparts on this page the QueryManager returns multiple LocationLists in the same postback.
All WebParts on the Resultspage have the same QueryNumber / QueryId.
Do you have any idea why i got a empty QueryManager? Could it be a timing problem?
I'd appreciate some advice :)