Google 搜索
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="chap3_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>My Google AJAX Search API Application </title>
<script src="http://www.google.com/jsapi?key=ABQIAAAA8tCc3YHvzref7QrlUtLBJxTBJaQEFP-mki-GESoXGMdJEk8LRhQpQtwvOJG0eFfTfF75a80qoXZ29Q" type="text/javascript"> </script>
<script language="Javascript" type="text/javascript">
// <![CDATA[
google.load("search", "1");
function OnLoad() {
// Create a search control
var searchControl = new google.search.SearchControl();
// Add in a full set of searchers
searchControl.addSearcher(new google.search.WebSearch());
// Tell the searcher to draw itself and tell it where to attach
searchControl.draw(document.getElementById("searchcontrol"));
// Execute an inital search
searchControl.execute("Google");
}
google.setOnLoadCallback(OnLoad);
//]]>
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="searchcontrol">Loading
![](/images/dot.gif)
<%-- <asp:TextBox ID="TextBox1" runat="server"> </asp:TextBox>
<asp:ListBox ID="ListBox1" runat="server" Width="241px"> </asp:ListBox>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" /> --%>
</form>
</body>
</html>