Integrating Search Server Express – reprised.

I’ll be one of the first to admit, Javascript is NOT my strong point.. or my favorite.. C# however is, so I amended the ASCX page to use C# throughout.

2 ASP controls for the Image and text box both of which have a click event “cmdRunSearch_Click”

This calls:-

protected void cmdRunSearch_Click(object sender, EventArgs e)
	string strEncodedUrl
		= SPEncode.UrlEncodeAsUrl("http://demosearch/results.aspx",false);

    string targetUrl = strEncodedUrl + "?k=" + txtSearchText.Text;

A little bit of styling on the asp objects and the new control adapter looks the part and performs well.

The only downside to this approach is that the ascx page has to be edited manually after the feature is installed to ensure the correct URL is used for the SSE implementation.

To take this further, I’m tempted to restore the scope activities that I took out of the original MS page, however this time we need to pull the scope options from the search centre, so this may need some thought.


Leave a Reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.