ASP.NET»ùÓÚJQUERYµÄAJAXµÄÑéÖ¤µÇ¼£¨JSON£©
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Ö÷Ò³</title>
<script src="js/jquery-1.2.6.js" type="text/javascript"></script>
<script src="js/thickbox.js" type="text/javascript"></script>
<link type="text/css" href="css/thickbox.css" rel="Stylesheet" />
</head>
<body>
<form id="form1" runat="server">
<div style="margin-left:auto; margin-right:auto;width:400px;">
<a href="ajaxLogin.html?height=120&width=250&modal=false" class="thickbox" title="ÇëµÇ¼">
ÎÒÒª½øÐÐJQUERYµÇ¼ÑéÖ¤</a>
<br />
Õ˺ţºadmin<br/>
ÃÜÂ룺admin<br />
</div>
</form>
</body>
</html>
login.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" Inherits="login" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>µÇ¼ÑéÖ¤</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
login.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.We
Ïà¹ØÎĵµ£º
Default3.aspx Code:
<%@Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"& ......
var XmlHttp;
var PathUrl;
function createXmlHttp() {
if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
  ......
²ÉÓÃAjax´«µÝ²ÎÊý¼ÓºÅ(+)ºÍÓë·ûºÅ(&)ʱºò£¬·þÎñ¶Ë»ñÈ¡µ½µÄ²ÎÊý²¢²»ÈçÒ⣡
(1) "+"ºÅ£ºJavaScript½âÎöΪ×Ö·û´®Á¬½Ó·û£¬ËùÒÔ·þÎñÆ÷¶Ë½ÓÊÕÊý¾Ýʱ"+"»á¶ªÊ§¡£
(2)"&"£ºJavaScript½âÎöΪ±äÁ¿Á¬½Ó·û£¬ËùÒÔ·þÎñÆ÷¶Ë½ÓÊÕÊý¾Ýʱ&·ûºÅÒÔºóµÄÊý¾Ý¶¼»á¶ªÊ§¡£
½â¾ö°ì·¨£ºÔÚ´«µ½·þÎñ¶Ë֮ǰÏȽ«²ÎÊýÖеÄ"+"ºÍ"&"·ûºÅ¶¼± ......
ÓÉÓÚ¾³£ÒªÐ´Ò»Ð©²É¼¯µÄ³ÌÐò£¬ÏÂÃæµÄÈý¸öº¯ÊýÊDzɼ¯Öеĺܳ£Óõĺ¯Êý¡£¹ÃÇҽвɼ¯ÏµÍ³ÍòÄÜÕýÔò±í´ïʽ°É¡£
µÚÒ»¸ö£º//»ñÈ¡Ò³ÃæµÄhtmlÔ´Âë
public string GetHtmlSource(string Url, string charset)
{
& ......