SharePoint has a search box by default at the top of the Portal. I want my WebPart to be able to intercept that search and provide search results. Is this possible, and if so any tips or links on how to do this?
views:
329answers:
3On the result page, just remove the Core Search Results webpart and add your webpart instead.
In your webpart, get the query from the querystring (argument k for keywords and s for scope).
You could use jQuery in your webpart and handle the onkeypress event of that textbox.
You actually have several options here. You can replace the CSR Web Part as Nico suggests. But you could also just change the target URL on your search scopes to point to another ASPX page where you have your own search result Web Part. Change the target URL by going to Site Settings -> Search Scopes. The target URL on Shared Scopes must, however, be edited at the level of the Shared Services Provider.
Finally, it is also possible to completely replace the search box on all pages. This is fairly simple as you just need to install a SharePoint Feature that instructs the underlying delegate control to show your search box instead of the SharePoint one. Deactivate the feature again and all pages in the site collection reverts to the original search box again. Clever eh? But you should of course only go for this solution if you fundamentally need to extend the behavior or layout of the search box.