views:

83

answers:

1

If you go the Sharepoint's Search Center -> Site Settings -> Search Settings. There's Site Collection Search Results Page which is used for configuring the search results page used for contextual searches (such as "This Site"). The default value is

/_layouts/osssearchresults.aspx

How can I retrieve and change this value through the SharePoint object model?

Thanks in advance.

+1  A: 

Hi Alexander

The setting is stored in:

site.RootWeb.AllProperties["SRCH_TRAGET_RESULTS_PAGE"] 

If doesn't exist or is null then '/_layouts/osssearchresults.aspx' is used

The Search Center URL is in

site.RootWeb.AllProperties["SRCH_ENH_FTR_URL"] 

And the drop down mode in

site.RootWeb.AllProperties["SRCH_SITE_DROPDOWN_MODE"] 
Per Jakobsen
This changes value of Site Collection Search Center (i.e. enables custom scopes). But I need to change the URL to layout itself.
Alexander
Upps :-( gave the setting for 2007, where the page was hardcoded. Answer is now updated for 2010.
Per Jakobsen
Thanks, now it works :)
Alexander