asp.net + jquery
<script type="text/javascript">
var loginName,checkUN,password,confirmPwd,email,subBtn,userName,checkTel,tel;
$(init);
function init()
{
loginName = $("#loginName");
loginName.bind("blur",checkUserName);
password = $("#password");
confirmPwd = $("#confirmPwd");
userName = $("#userName");
userName.bind("blur",checkRN);
password.bind("blur",checkPwd);
confirmPwd.bind("blur",checkConfPwd);
email = $("#email");
email.bind("blur",checkEmail);
subBtn = $("#subBtn");
subBtn.bind("click",subUser);
checkTel = $("#checkTel");
tel = $("#tel");
tel.bind("blur",chkTel);
}
function checkUserName()
{
loginName = $("#loginName").val();
if(jQuery.trim(loginName)=="")
{
$("#loginName").focus();
$("#checkUN").css("color","Red");
$("#checkUN").text("Óû§Ãû²»ÄÜΪ¿Õ");
return false;
}
else
{
$("#checkUN").text("ÑéÖ¤ÖÐ...");
$.post("checkUser.ashx?tm="+new Date().getDate()+"&loginName="+loginName,function (result){
if(result=="0")
{
Ïà¹ØÎĵµ£º
ÏîÄ¿ºÍÍøÕ¾µÄÇø±ð
ÏîÄ¿±àÒë³Édll£¬Íøվͨ¹ý“·¢²¼ÍøÕ¾”À´²¿Êð
²¿ÊðÄ¿µÄµØ£º/binĿ¼ÏÂ
7¸ö¶¥¼¶Ä¿Â¼¼°Æä±àÒëÇé¿ö
ÈýÖÖ²¿Êð·½Ê½¼°Æä³ÌÐò¼¯Éú³ÉÇé¿ö £¨³ÌÐò¼¯Ó°×Ó¿½±´£©
¶¨ÖƳÌÐò¼¯Éú³É£º
<compilation>
<codeSubDirectories>
<add directoryName="vb_components"/ ......
Js´úÂë
var url=Service.aspx?Value=' + escape(va);
obj=CreateAJAX();
if(obj)
& ......
ÔÚÁ˽âHTTP¶ÏµãÐø´«µÄÔÀí֮ǰ£¬ÏÈÀ´ËµËµHTTPÐÒ飬HTTPÐÒéÊÇÒ»ÖÖ»ùÓÚtcpµÄ¼òµ¥ÐÒ飬·ÖΪÇëÇóºÍ»Ø¸´Á½ÖÖ¡£ÇëÇóÐÒéÊÇÓÉ¿Í»§»ú(ä¯ÀÀÆ÷)Ïò·þÎñÆ÷£¨WEB SERVER£©Ìá½»ÇëÇóʱ·¢Ëͱ¨ÎĵÄÐÒé¡£»Ø¸´ÐÒéÊÇÓÉ·þÎñÆ÷(web server)£¬Ïò¿Í»§»ú(ä¯ÀÀÆ÷)»Ø¸´±¨ÎÄʱµÄÐÒé¡£ÇëÇóºÍ»Ø¸´ÐÒ鶼ÓÉÍ·ºÍÌå×é³É¡£Í·ºÍÌåÖ®¼äÒÔÒ»ÐпÕÐÐΪ·Ö¸ô¡£
......
dzÎöASP.NETµÄPage.IsPostBack ÊôÐÔ
http://www.sina.com.cn 2008Äê05ÔÂ06ÈÕ 11:33 IT168.com
¡¾IT168¼¼ÊõÎĵµ¡¿
ÏÖÔÚ´Ó¶ÔASP.NETÒ³ÃæµÄÖ´ÐÐ˳Ðò¿ªÊ¼£¬Ìå»áÒ»ÏÂB/S½á¹¹µÄ³ÌÐòµÄÌص㣬ÏÂͼÊÇASP.NETÒ³ÃæµÄÖ´ÐÐ˳Ðò˵Ã÷£º
Page_Init£¨Ò³Ãæ³õʼ»¯Òý·¢µÄʼþ£©——>Page_Load£¨¼ÓÔ ......
ASP.NETÒ³ÃæÌøתÓÐʲô·½·¨ÄØ£¿£¬ÏÖÔÚ¸ø´ó¼Ò½éÉÜÈýÖÖ·½·¨£¬ËûÃǵÄÇø±ðÊÇʲôÄØ£¿ÈÃÎÒÃÇ¿ªÊ¼°É£º
ASP.NETÒ³ÃæÌøת1¡¢response.redirect Õâ¸öÌøתҳÃæµÄ·½·¨ÌøתµÄËٶȲ»¿ì£¬ÒòΪËüÒª×ß2¸öÀ´»Ø(2´Îpostback)£¬µ«Ëû¿ÉÒÔÌø תµ½ÈκÎÒ³Ã棬ûÓÐÕ¾µãÒ³ÃæÏÞÖÆ(¼´¿ÉÒÔÓÉÑÅ»¢Ìøµ½ÐÂÀË)£¬Í¬Ê±²»ÄÜÌø¹ýµÇ¼±£»¤¡£µ«ËÙ¶ÈÂýÊÇÆä×î´óȱÏÝ ......