注册验证哪错了?
Cili.js页function showHint(str)
{
if (str.length > 0 && str != null)
{
Customer.innerHTML="验证用户名....";
//var url="checkuser.asp?sid=" + Math.random() + "&CustomerID=" + str
var url="../Member/checkData.aspx?CustomerID=" + str
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}
else
{
document.getElementById("Customer").innerHTML=""
}
}
checkData.aspxd页应该怎么写?我下面的通不过
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Member_checkData : System.Web.UI.Page
{
SqlConnection strcon = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]);
strcon.Open();
string CardId = this.CardId.Text.ToString();
SqlCommand cmd = new SqlCommand("select count(*) from Users where userid="+Request["CustomerID"], strcon);
int count = Convert.ToInt32(cmd.ExecuteScalar());
if (count > 0)
{
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
返回页提示验证失败