¼òµ¥µÄAJAX»ñÈ¡Êý¾Ý¿â±íÊý¾Ý
A.aspxÒ³Ãæ·ÅÒ»¸ödropdownlist£¬ÔÚA.aspx.csÌí¼Ó£º this.drpSchool.Attributes.Add("onchange", "load(this.options[this.selectedIndex].value)");
ÔÚA.aspxÒ³ÃæÌí¼ÓÈçϽű¾£º
function load(state){
var oHttpReq = new ActiveXObject("MSXML2.XMLHTTP");
var oDoc = new ActiveXObject("MSXML2.DOMDocument");
oHttpReq.open("POST", "../B.aspx?state="+state, false);
oHttpReq.send("");
result = oHttpReq.responseText;
oDoc.loadXML(result);
items1 = oDoc.selectNodes("//NewDataSet/Table/dtid");
items2 = oDoc.selectNodes("//NewDataSet/Table/dtname");
var itemsLength=items1.length;
¡¡¡¡for(i=0;i<itemsLength;i++)
//½«Ð¡ÀàµÄÀàÃûºÍ±àºÅ¸³ÓèDropDownList2
¡¡¡¡{
¡¡
¡¡¡¡var newOption = document.createElement("OPTION");
¡¡¡¡newOption.text=items2[i].text;
¡¡¡¡newOption.value=items1[i].text;
¡¡¡¡drp2.options.add(newOption);
¡¡¡¡//¡¡newOption.value=6;
¡¡
¡¡¡¡}
}
B.aspx.csÒ³Ã棺
if (Request.QueryString["state"] != null && Request.QueryString["state"].ToString() != "")
{
try
{
int shengNo = int.Parse(Request["state"].ToString());
// int shengNo = 1;
DataSet ds = new DataSet();
db dbb = new db();
ds = dbb.GetDataSet(SQLÓï¾ä);
if (ds.Tables[0].Rows.Count > 0)
&nb
Ïà¹ØÎĵµ£º
ajax Detail.aspxÒ³Ãæ
protected void Page_Load(object sender, EventArgs e)
{
Thread.Sleep(500);
string Keyid = Request.QueryString["Id"].ToString();
......
Ajax
Ö÷
Òª×é³É²¿·Ö
Ajax
ÊÇ
Asynchronous JavaScript and XML
£¨ÒÔ
¼°
DHTML
µÈ£©µÄËõд¡£
Ajax
ÓÉ
HTML
¡¢
JavaScript™
¼¼Êõ¡¢
DHTML
ºÍ
DOM
×é³É£¬ÕâÒ»½Ü³öµÄ·½·¨¿ÉÒÔ½«±¿×¾µÄ
Web
½çÃæת»¯³É½»»¥ÐÔµÄ
Ajax
Ó¦ÓóÌÐò¡£
AjaxµÄºËÐÄÊÇJavaScript¶ÔÏó XmlHttpRequest¡£¸Ã¶ÔÏóÔ ......
<html>
<body>
<script type="text/javascript">
function ajaxFunction()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Inte ......
Ò³Ãæ´úÂ룺
<head runat="server">
<title>ÎÞ±êÌâÒ³</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManage ......
ÎҵĴºÇï³ÕÃεڶþ²½£º
дһ¸ö ͨÓÃµÄ ¶ÔÏó ÁÐ±í £¬»¹ °üº¬ ËÑË÷ºÍ ÊôÐÔ¹ýÂË¡£
¾ßÌåµÄЧ¹ûÊÇ£º
µ±Ð ҵÎñ Ìí¼ÓÒ»¸ö ±íµÄʱºò£¬Ö»ÐèÒªÔÚ ¶ÔÏóÄ£ÐÍÀïµÄ Ìí¼ÓÒ»¸ö model
ºǫ́¼¸ºõ²»Ðèд´úÂë¡£
(ÎÒÊǺǫ́£º¼¤¶¯ÈËÐÄ£¡)
µ÷ÓõĶÔÏ󣬵ڼ¸Ò³£¬ÊôÐ﵀ ¹ýÂË ºÍËÑË÷È«ÊÇ Ç°Ì¨µÄAjax²ÎÊý¿ØÖÆ
(ÎÒÊÇǰ̨£º#$!@#$%$^#$% ......