<div class="pull-left"> <input id="username" name="username" type="text" class="form-control isUsername" onblur = "CheckUserName()"> </div>
function CheckUserName()
{
var userName = $("#username").val();
var Option =
{
url: encodeURI('/Handler/AuthAccounts.ashx?action=checkusername&userName='+userName),
type: "get",
dataType: 'text',
cache: false, //设置为 false 将不会从浏览器缓存中加载请求信息。
async: true, //(默认: true),所有请求均为异步请求。发送同步请求,请将此选项设置为 false。同步请求将锁住浏览器,用户其它操作必须等待请求完成才可以执行。
timeout: 150000, //设置请求超时时间(毫秒)。此设置将覆盖全局设置。
error: function ()
{
},
success: function (data, textStatus)
{
if (data == null || data == undefined)
{
return false;
}
jsondata = eval('(' + data + ')');
if (jsondata.state == "success")
{
alert(jsondata.message);
return false;
}
},
beforeSend: function () //检查之前,是否通过格式验证
{
var text = $("#username-error").text();
if (text != ""&&text!=undefined&&text!=null)
{
return false;
}
}
};
jQuery.ajax(Option);
return false;
}
/// <summary>
/// 检查用户名是否已经存在
/// </summary>
/// <param name="context"></param>
protected void CheckUserName(string userName)
{
CommonStruct commonStruct = new CommonStruct();
if (userName != "" && userName!=string.Empty)
{
QingCi.Model.ExecResultData result = QingCi.BLL.AuthAccounts.CheckUserNameExist(userName);
if (result.State == stateSuccess)
{
commonStruct.state = stateSuccess;
commonStruct.message = result.Message;
HttpContext.Current.Response.Write(serializer.Serialize(commonStruct));
HttpContext.Current.Response.End();
}
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有