Reg.aspx中
function Customer_check(infobox)
{
var inputValue = document.getElementById('Register1_txtUsername').value;
//var cu = document.getElementById("userID").value;
//alert(cu);
if(!ValidateUserName(inputValue,infobox))
return false; showHint(inputValue)
}var xmlHttp
var urll;
function showHint(str)
{
if (str.length > 0 && str != null)
{
Customer.innerHTML="验证用户名....";
var url="DisposeEvent.aspx?CustomerID=" + str
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}
else
{
document.getElementById("Customer").innerHTML=""
}
}
DisposeEvent.aspx
if (!this.IsPostBack)
{
string CustomerID = Request["CustomerID"] = null ? "" : Request["CustomerID"].ToString().Trim();
if (CustomerID != "")
{
strcon.Open();
string strSql = "select count(*) from tb_User where Userid = '" + CustomerID + "'";
SqlCommand Use = new SqlCommand(strSql, strcon);
if (Convert.ToInt32(Use.ExecuteScalar()) > 0)
{
Response.Write("true"); Response.End();
}
else
{
Response.Write("false"); Response.End();
}
strcon.Close();
}
为什么一直提示用户名存在要不就是失败??DisposeEvent.aspx中哪出错???
function Customer_check(infobox)
{
var inputValue = document.getElementById('Register1_txtUsername').value;
//var cu = document.getElementById("userID").value;
//alert(cu);
if(!ValidateUserName(inputValue,infobox))
return false; showHint(inputValue)
}var xmlHttp
var urll;
function showHint(str)
{
if (str.length > 0 && str != null)
{
Customer.innerHTML="验证用户名....";
var url="DisposeEvent.aspx?CustomerID=" + str
xmlHttp=GetXmlHttpObject(stateChanged)
xmlHttp.open("GET", url , true)
xmlHttp.send(null)
}
else
{
document.getElementById("Customer").innerHTML=""
}
}
DisposeEvent.aspx
if (!this.IsPostBack)
{
string CustomerID = Request["CustomerID"] = null ? "" : Request["CustomerID"].ToString().Trim();
if (CustomerID != "")
{
strcon.Open();
string strSql = "select count(*) from tb_User where Userid = '" + CustomerID + "'";
SqlCommand Use = new SqlCommand(strSql, strcon);
if (Convert.ToInt32(Use.ExecuteScalar()) > 0)
{
Response.Write("true"); Response.End();
}
else
{
Response.Write("false"); Response.End();
}
strcon.Close();
}
为什么一直提示用户名存在要不就是失败??DisposeEvent.aspx中哪出错???
==
string CustomerID = Request["CustomerID"] == null ? "" : Request["CustomerID"].ToString().Trim();