| <%@ Page language="c#" Codebehind="WebForm2.aspx.cs" AutoEventWireup="false" Inherits="WebApptest1.WebForm2" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML> <HEAD> <title>WebForm2</title> <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR"> <meta content="C#" name="CODE_LANGUAGE"> <meta content="JavaScript" name="vs_defaultClientScript"> <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"> <script> function load(state){ var drp2 = document.getElementById("DropDownList2"); for(var i = 0;i<=drp2.options.length -1;i++){ drp2.remove(i); } var oHttpReq = new ActiveXObject("MSXML2.XMLHTTP"); var oDoc = new ActiveXObject("MSXML2.DOMDocument"); oHttpReq.open("POST", "webform6.aspx?state="+state, false); oHttpReq.send(""); result = oHttpReq.responseText; oDoc.loadXML(result); items = oDoc.selectNodes("//CITY/Table"); for (var item = items.nextNode(); item; item = items.nextNode()){ var city = item.selectSingleNode("//city").nodeTypedValue; var newOption = document.createElement("OPTION"); newOption.text = city; newOption.value = city; drp2.options.add(newOption); } } </script> </HEAD> |