首页 > Web开发 > 详细

asp.net ajax 检测用户名是否可用代码

时间:2014-02-18 16:04:39      阅读:442      评论:0      收藏:0      [点我收藏+]

原文  asp.net ajax 检测用户名是否可用代码

.net ajax 检测用户名是否可用代码

<script type="text/网页特效" src="css教程/jquery-1.3.2.js"></script> 
<script type="text/javascript"> 
function judgeusername() 

$.ajax({ 
type:"get", 
url:"ajaxuserinfomodify.aspx", 
datatype:"html", 
data:"username="+$("#txtname").val(), 
beforesend:function(xmlhttprequest) 

$("#showresult").text("正在查询"); 
//pause(this,100000); 
}, 
success:function(msg) 

$("#showresult").html(msg); 
$("#showresult").css("color","red"); 
}, 
complete:function(xmlhttprequest,textstatus) 

//隐藏正在查询图片 
}, 
error:function() 

//错误处理 

}); 

</script>


<div> 
<input id="txtname" type="text" /><input type="button" value="查看用户名是否存在" id="btn" onclick="judgeusername();" /> 
<div id="showresult" style="float:left">div> 
div>

aspx文件

protected void page_load(object sender, eventargs e) 

string username = request.querystring["username"].tostring (); 
if (username == "james hao") 

response.write ("用户名已经存在!"); 

else 

response.write ("您可以使用此用户名!"); 

}

asp.net ajax 检测用户名是否可用代码

原文:http://www.cnblogs.com/lonelyxmas/p/3554077.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!