Introduction
This solution helps to view SharePoint search results along with Google results within a SharePoint portal.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Text;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class SharepointGoogleSearchIntegration : System.Web.UI.UserControl
{
#region PageLoad
protected void Page_Load(object sender, EventArgs e)
{
if ((Request.QueryString["k"] != null) &&
((Request.QueryString["k"] != "")))
{
hdnField.Value = Request.QueryString["k"].ToString();
hdnField.EnableViewState = true;
}
InitalizeScripts();
}
#endregion
protected void InitalizeScripts()
{
String sb = string.Empty;
sb = "<script type='text/javascript' language="'javascript'">"
+ "function LoadValues()"
+ "{"
+ "var hiddenval = '" + hdnField.Value + "';"
+ "return hiddenval;"
+ "}"
+"</script>";
Page.RegisterClientScriptBlock("ClientScript", sb.ToString());
}
}
SharePoint - Google - Search Integration allows the user to view the web results within the SharePoint portal. The user doesn't need to specify the text separately into two search controls. The default SharePoint Search WebPart is used to pass the query to other WebParts which produce the web results at the same time.
In case of any queries, you can revert to me at "pankaj.pahuja@gmail.com" or "pankaj_proteans@hotamil.com".