前台:<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="SYMangQY_Default" EnableEventValidation="false"%><!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" method="post" runat="server">
<SCRIPT LANGUAGE="JavaScript">
<!--
//以XML求取数据
function XmlPost(obj,tb1,tb2,dp1)
{
var svalue = obj.value;
var webFileUrl = "?brc_id=" + svalue;
//alert(svalue);
var result = "";
var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlHttp.open("POST",webFileUrl,false);
xmlHttp.send("");
result = xmlHttp.responseText;
if(result != "")
{
document.all(dp1).length=0;
document.all(dp1).options.add(new Option("--请选择车辆--","-1"));
document.all(tb1).value="";
document.all(tb2).value="";
var piArray = result.split(",");
for(var i=0;i<piArray.length;i++)
{
var ary1 = piArray[i].toString().split("|");
//alert(ary1[0].toString());
document.all(dp1).options.add(new Option(ary1[1].toString(),ary1[0].toString()));
}
}
else
{
document.all(dp1).length=0;
document.all(dp1).options.add(new Option("--请选择车辆--","-1"));
document.all(tb1).value="";
document.all(tb2).value="";
//alert(result);
}
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
//以XML求取数据
function XmlPostP(obj,tb1,tb2)
{
var svalue = obj.value;
var webFileUrl = "?P_id=" + svalue;
//alert(svalue);
var result = "";
var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlHttp.open("POST",webFileUrl,false);
xmlHttp.send("");
result = xmlHttp.responseText;
if(result != "")
{
document.all(tb1).value="";
document.all(tb2).value="";
var piArray = result.split("^");
for(var i=0;i<piArray.length;i++)
{
document.all(tb1).value=piArray[0].toString()
document.all(tb2).value=piArray[1].toString()
}
}
else
{
document.all(tb1).value="";
document.all(tb2).value="";
//alert(result);
}
}
//-->
</SCRIPT>
<div>
<asp:DropDownList ID="ddlCY" runat="server">
</asp:DropDownList>
<asp:DropDownList ID="ddlCP" runat="server">
</asp:DropDownList>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
</form>
</body>
</html>
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="Form1" method="post" runat="server">
<SCRIPT LANGUAGE="JavaScript">
<!--
//以XML求取数据
function XmlPost(obj,tb1,tb2,dp1)
{
var svalue = obj.value;
var webFileUrl = "?brc_id=" + svalue;
//alert(svalue);
var result = "";
var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlHttp.open("POST",webFileUrl,false);
xmlHttp.send("");
result = xmlHttp.responseText;
if(result != "")
{
document.all(dp1).length=0;
document.all(dp1).options.add(new Option("--请选择车辆--","-1"));
document.all(tb1).value="";
document.all(tb2).value="";
var piArray = result.split(",");
for(var i=0;i<piArray.length;i++)
{
var ary1 = piArray[i].toString().split("|");
//alert(ary1[0].toString());
document.all(dp1).options.add(new Option(ary1[1].toString(),ary1[0].toString()));
}
}
else
{
document.all(dp1).length=0;
document.all(dp1).options.add(new Option("--请选择车辆--","-1"));
document.all(tb1).value="";
document.all(tb2).value="";
//alert(result);
}
}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
//以XML求取数据
function XmlPostP(obj,tb1,tb2)
{
var svalue = obj.value;
var webFileUrl = "?P_id=" + svalue;
//alert(svalue);
var result = "";
var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlHttp.open("POST",webFileUrl,false);
xmlHttp.send("");
result = xmlHttp.responseText;
if(result != "")
{
document.all(tb1).value="";
document.all(tb2).value="";
var piArray = result.split("^");
for(var i=0;i<piArray.length;i++)
{
document.all(tb1).value=piArray[0].toString()
document.all(tb2).value=piArray[1].toString()
}
}
else
{
document.all(tb1).value="";
document.all(tb2).value="";
//alert(result);
}
}
//-->
</SCRIPT>
<div>
<asp:DropDownList ID="ddlCY" runat="server">
</asp:DropDownList>
<asp:DropDownList ID="ddlCP" runat="server">
</asp:DropDownList>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
</form>
</body>
</html>
</asp:DropDownList>改为
<select id="ddlCP" runat="server">
</select>
我也是的..
放到TblControl容器里的