Integrate Bing Search in your .NET Framework Application | CodeGuru

Integrate Bing Search in your .NET Framework Application

Introduction In this article you will learn how to integrate the Bing search in your ASP.NET application. The Bing Developer Center exposes a few APIs for Bing search which can be used to integrate it in your .NET framework application. Our applications can make requests with the required parameters to the Bing search APIs and […]

Written By
CodeGuru Staff
CodeGuru Staff
Jul 16, 2010
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Introduction

In this article you will learn how to integrate the Bing search in your ASP.NET application. The Bing Developer Center exposes a few APIs for Bing search which can be used to integrate it in your .NET framework application. Our applications can make requests with the required parameters to the Bing search APIs and get the search results back.

The Bing API’s are exposed through HTTP and can support the message formats below.


  1. SOAP

  2. JSON

  3. XML

What is the use?

For most of the readers the first thought to cross their minds is, what would be the use of integrating Bing Search into our application. The obvious answer would be, so the user doesn’t have to leave your web site in case he needs to search the web.

In order to use the Bing APIs you need to have a valid AppId. You can get the AppId by going to the Microsoft Developer Center and follow the steps below.


  1. Sign in using your Windows Live Id. If you don’t have one then please go ahead and create it.
  2. Click on the link “Create new AppId”, which will take you to a form. Fill in the form and click on Agree. Fig 1.0 shows the screen shot of the AppId form.

  3. Fig 1.0

  4. The AppId will be displayed on the page. Copy it and have it for the usage in our application.

Advertisement

Implementing Bing Search in an ASP.NET application

Let us create an ASP.NET application and then implement the Bing search in it. I will be using the Bing search API for SOAP in our demo application.

Using Microsoft Visual Studio 2010 create an ASP.NET Web Application and name it as BingSearchAPIDemo. Now open the web.config file and add an appSettings value for the AppId as shown below.

<appSettings>
    <add key=”BingAppId” value=”XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”/>
</appSettings>

Add a webform named SearchPage.aspx. Fig 2.0 is the .aspx designer code.



Fig 2.0

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.