就是为了输入一个id,点击button就能把数据插入到数据库中
前面的代码:<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    
<title>
</title>
    
<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1.js"></script>
<script type="text/javascript" src="Scripts/jquery-1.4.1-vsdoc.js"></script>
    
<script type="text/javascript">
      var function xz(){
     
        var tbid = $("#tbid").val();
      
         var para = "&tbid=" + tbid;
                
         $.ajax({
             type: "POST",
             url: "handler12.aspx",
             data: "fnName=xinzeng" + para,
             dataType: "json",
         });
    }    function shanchu(){
     
        var tbid = $("#tbid").val();
      
         var para = "&tbid=" + tbid;
                
         $.ajax({
             type: "POST",
             url: "handler12.aspx",
             data: "fnName=shanchu" + para,
             dataType: "json",
        });
    }    </script>
     
</head>
<body>
    <form id="form1" runat="server">
<div id="huiyuan"><h3>来自淘宝的会员</h3></div>淘宝ID:<input id="tbid" type="text" name="tbid" size="30" /><input id="xinzeng" onclick="xz();"  type="button" name="xinzeng" value="新增"/><input  id="shanchu" onclick="shanchu();" type="button" name="shanchu" value="删除"/>    
</form>
</body>
</html>后台的代码:namespace WebApplication1
{
    public partial class handler12 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DbHelperSQL.connectionString = "server=localhost;database=huiyuan;uid=sa;pwd=sa";
        }        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);
            Response.Clear();            string rtn = "";            string fnName = "";
            if (Request.Form["fnName"] != null)
            {
                fnName = Request.Form["fnName"].ToString();
            }            switch (fnName)
            {
                case "xinzeng":
                    rtn = xinzeng();
                    break;
                case "shanchu":
                    rtn = shanchu();
                    break;
                case"wxidcheck":
                    rtn=wxidcheck();
                    break;
                default:
                    break;
            }            Response.Write(rtn);        }
        //新增
        private string xinzeng()
        {
            string tbid = "";
            string insertsql = "";            if (Request.Form["tbid"] != null && Request.Form["tbid"] != "")
            {
                insertsql = "insert into huiyuan(tbid) values('" + Request.Form["tbid"] + "')";
                 
                if (DbHelperSQL.ExecuteSql(insertsql) == 1)
                {
                    return "{\"成功增加!\"}";                }
                else
                {
                    return "{\"error\":\"淘宝id不能为空!\"}";
                }            }
            else
            {
                return "{\"error\":\"淘宝不能为空!\"}";
            }        }}
}
 现在的问题是我一测试,就提示说 ReferenceError: xz is not definedVisual Studio数据库vs web前端