ASP.NET  •  Use the GoogleBox

Listing 1. Dropping the GoogleBox onto a page is as easy as adding a single tag. You can customize the formatting of the results list using the FormatString parameter. The ErrorMessage string is shown when an error occurs or the Google Web service is unavailable. Make sure to include the license key you received when you registered with Google.

<%@ Page Language="vb" AutoEventWireup="false" %>
<%@ Register TagPrefix="vsm" TagName="GoogleBox" 
   Src="GoogleBox.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 
   Transitional//EN" >
<html>
<body>
   <form id="Form1" method="post" runat="server">
      <vsm:GoogleBox
         ID="googlebox1"
         Key=""
         Query=""Visual Studio""
         FormatString="<small><b>{0}</b>. 
            <a target="_blank" 
            href="{2}">{1}</a></small>
            <br>"
         MaxResults="3"
         CacheMinutes="5"
         ErrorMessage="Sorry, search results 
            temporarily unavailable"
         RunAt="server" />
   </form>
</body>
</html>