Displaying Search Results to Results Page using the Site Search Templated Server Control.

  • Updated

How to display search results to a separate results page while using the SiteSearch Control.

Here is the link to the documentation on the .ASPX code.

Site Search Documentation

The solution is to create the search box and button on on template and to send the search term to the results page in the QueryString.

In the search results page you would have the control on the page as described in the link above, and the code in the code-behind.

A working sample of this with the templated search control can be found here.

         protected void Page_PreRender(object sender, EventArgs e)
         {
             if (!IsPostBack)
             {
                 if (!String.IsNullOrEmpty(Request.QueryString["q"]))
                 {
                     uxSearchController.Search(Request.QueryString["q"]);
                 }
             }
         }