网(LieHuo.Net)教程 用JS来操作一个XML文档来实现一个简单的表单联动。
aspx页面:
以下为引用的内容: aspx页面: <table cellspacing="0" cellpadding="0" width="100%" border="0"> <tr> <td height="25" width="30%" align="right"> UName : </td> <td height="25" width="*" align="left"> <asp:TextBox ID="txtUName" runat="server" Width="200px"></asp:TextBox> </td> </tr> <tr> <td height="25" width="30%" align="right"> UCountry : </td> <td height="25" width="*" align="left"> <asp:TextBox ID="txtUCountry" runat="server" Width="200px"></asp:TextBox> </td> </tr> <tr> <td height="25" width="30%" align="right"> UProvince : </td> <td height="25" width="*" align="left"> <asp:DropDownList ID="ddlUProvince" runat="server" onchange="ResetCity(this,'ddlUCity');"> </asp:DropDownList> </td> </tr> <tr> <td height="25" width="30%" align="right"> UCity : </td> <td height="25" width="*" align="left"> <asp:DropDownList ID="ddlUCity" runat="server"> </asp:DropDownList> </td> </tr> <tr> <td height="25" colspan="2"> <div align="center"> <asp:Button ID="btnAdd" runat="server" Text="注册" OnClick="btnAdd_Click"></asp:Button> </div> </td> </tr> </table> <script> InitProvince('ddlUProvince');</script> |
aspx.cs:
以下为引用的内容: string province=Request["ddlUProvince"]; string city=Request["ddlUCity"]; |
JS+XML下载:js+xml_city.rar