一运行就提示错误!!
<%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<HEAD>
<title>无标题页</title>
<script language="javascript" src="lookup.js"></script>
<script language="javascript">
    mainLoop = function()
    {
    val = escape(queryField.value);
    if (lastVal != val)
    {
    var response = _Default.GetSearchItems(val);
    showQueryDiv(response.value);
    lastVal = val;
    }
    setTimeout('mainLoop()', 100);
    return true;
    }
</script>
</HEAD>
<body onload="javascript:InitQueryCode('search')">
<form id="form1" runat="server">
<asp:Label id="Label1" runat="server" Font-Names="黑体,Arial Black" Font-Bold="True" Font-Size="X-Large">基于AJAX的自动完成功能</asp:Label>
<hr>
<div>请输入FirstName:<input name="search" type="text" id="search" autocomplete="off" runat="server">&nbsp;&nbsp;&nbsp;<asp:Button id="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click"></asp:Button></div>
<br>
<div id="container" style="WIDTH:500px;HEIGHT:30px">
<div class="panel">
<fieldset>
<legend>数据区域</legend>
<p id="Result" style="FONT-WEIGHT:bold;FONT-SIZE:16px;COLOR:red"><FONT face="宋体">
<asp:DataGrid id="DataGrid1" runat="server"></asp:DataGrid></FONT>
</p>
</fieldset>
</div>
</div>
</form>
</body>
</HTML>

解决方案 »

  1.   

    行: 13
    字符:9
    错误: ‘_Default’未定义
      

  2.   

    _Default这个js类在lookup.js里面么?如果不在你需要引用
    另外假如你这个页面涉及的代码没有调用mainloop的话,那么这个是不会执行的并且mainloop是循环的。
      

  3.   

    确实没在lookup.js里!
    请问怎么引用呀?
      

  4.   

    _Default应为 Class 名, 你可看看 .cs中的Class是否为"_Default" 还是"Default"
      

  5.   

    .cs中是这样的!
    public class _Default : System.Web.UI.Page 
    {
    protected System.Web.UI.WebControls.Label Label1;
    protected System.Web.UI.WebControls.Button btnSearch;
    protected System.Web.UI.WebControls.DataGrid DataGrid1;
    protected System.Web.UI.HtmlControls.HtmlInputText search;
    Conn conn = new Conn();
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default));
            DataBindGridView();
        }
      

  6.   

    你搜索一下_default在哪里出现了?你用的是什么ajax框架?
      

  7.   

    http://www.cnblogs.com/Jinglecat/archive/2007/07/14/817812.html
    你看看这个文章