B2C Custom Search Result Page

  1. On a page on your web site you need to create an iframe. It doesn’t matter what you call this page because you will create a link to it on the B2C Consumer dashboard.  The minimum to view this iFrame without a horizontal scroll bar is 900px wide – any height.
  2. <iframe id="ifResults" style="width: 900px; height: 1020px;"></iframe>
  3. On your new results page - from the server side, you will need to write code to iterate through the query string  values, and build the source URL for the IFrame on the page.  The querystring value for “resultsurl” will be the base URL; and the remaining querystring values will be used to compose the query string for the IFrame.  In the below examples; set the IFrame’s source to the “iFrameURL” variable.
  4. In .NET, the code to generate the URL for the IFrame (iFrameURL) might look something like this:
    if (Request.QueryString["resultsurl"] != null
    {
              Results.Attributes.Add("src", Request.QueryString["resultsurl"] + "?" + Request.QueryString);
    }
  5. This can even be done client side, using javascript; something like so:
    <scripttype="text/javascript">
    function getArgs() {
    var args = new Object();
    var query = location.search.substring(1);
    var pairs = query.split("&");
    for (var
    i = 0; i < pairs.length; i++) {
    var pos = pairs[i].indexOf('=');if (pos == -1) continue;
    var argname = pairs[i].substring(0, pos);
    var value = pairs[i].substring(pos + 1);
    value = decodeURIComponent(value);
    args[argname] = value;}return args;}
    var args = getArgs();
    document.getElementById('frmSearch').src = args.resultsurl + '?'+ location.search.substring(1);
    </script>
  6. From the cruiseexpress B2C consumer dashboard page; set the URL to the URL of your new results page (i.e. http://mysite.net/results.html).