Õâ¸öAJAXÄÄÀï´íÁËÄØ
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ÎÞ±êÌâÎĵµ </title>
</head>
<script language="JavaScript" type="text/JavaScript">
function Login(username,password)
{
var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP")
xmlHttp.open("POST", "2-1.asp?username="+username+"&password="+password,false)
xmlHttp.send()
var re=xmlHttp.responseText;
//alert(re);
//setTimeout("Login(sendvalue.username.value,sendvalue.password.value)",1000);
}
</script>
<body>
<form method=post name=sendvalue>
<input type=text name=username>
<input type=password name=password>
<input name="ok" type="button" value="/Ìá½»" onClick="Login(sendvalue.username.value,sendvalue.password.value)">
</form>
<div id="re"> </div>
</body>
</html>
2-1.aspÎļþÈçÏ£º
<%
response.Write request("username")
response.Write request("password")
%>
<script language="JavaScript" typ
Ïà¹ØÎÊ´ð£º
ǰ̨´úÂë:
HTML code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %>
<!DOCTYPE html PUBLIC &qu ......
C# code:
<script type="text/javascript">
function get(aid){
$.ajax({
url:"t2.aspx?id="+aid+" & time="+new Date().toString(),
ty ......
ÓÃasp.netµÄajaxʵÏÖµã»÷ͼһµÃµ¥Ñ¡°´Å¥¡°ÊÇ¡±£¬ÏÔʾͼ¶þµÄÒþ²Øpanel(panelÄÚ°üº¬ÉÏ´«¿Ø¼þ)
panelÒ³Ãæ¼ÓÔØʱÊÇÒþ²ØµÄ
µ«Êǵ±ÌύʱpanelµÄfileuploadÏÔʾûÓÐÎļþ
µ±ÎÒ°ÑpanelµÄvisiab ......
request.responseText¿ÉÒԵõ½·µ»ØµÄÒ³ÃæÊý¾Ý
µ«ÊÇÔÚ·þÎñÆ÷¶ËÉèÖõÄattribute£¬Ôڻص÷º¯ÊýÖУ¬Í¨¹ýrequest.getAttributeûÓа취µÃµ½
ÁíÍâ·¢ÏÖresponseText²»ÊDZê×¼µÄrequestµÄ·½·¨£¬Õâ¸öapiÔÚÄÄ¿ÉÒÔ²éµ½Ä ......