Search Me…

Search Me…

  • Comments 1

Ashish pointed you at the Windows Live Dev center, so I thought I would give you an idea how easy it is to use the web services in your own applications by showing you how to leverage Windows Live Search to provide search functionality on YOUR web site.

You need to start the process by going to and provisioning yourself an "Application ID" which is your unique key to call the web service. It is a very quick process that gives you a string of characters that you need to pass with each call.

Once you have that, calling the search web service is as easy as adding a "web reference" to and dropping in a few lines of code.

For this example, we will call the search service when users click the "Search" button on our ASP .NET web site and then bind the results to a GridView control.

protected void Search_OnClick(object sender, EventArgs e)


SearchRequest searchRequest = new SearchRequest();

searchRequest.AppID = "<insert your unique AppID here>";

searchRequest.CultureInfo = "en-US";

searchRequest.Query = string.Format("{0}", Textbox1.Text);


SourceRequest webSource = new SourceRequest();

webSource.Source = SourceType.Web;

searchRequest.Requests = new SourceRequest[] { webSource };


MSNSearchService s = new MSNSearchService();

SearchResponse searchResponse = s.Search(searchRequest);


GridView1.DataSource = searchResponse.Responses[0].Results;



Pretty powerful stuff – dive in and give it a try, maybe on your own console app…

Page 1 of 1 (1 items)
Leave a Comment
  • Please add 6 and 1 and type the answer here:
  • Post