rt.

解决方案 »

  1.   

    自动生成DropDownList的个数?
    在后台创建DropDownList吗
      

  2.   

    如何获取在页面上生成的多个DropDownList并给它赋值!
      

  3.   


    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default8.aspx.cs" Inherits="Default8" %><!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 id="Head1" runat="server">
        <title></title>    <script src="jQuery学习/jquery-1.4.2.js" type="text/javascript"></script>    <script type="text/javascript">
            $(function() {
                alert($("select").length);
            });   
                
        </script></head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:DropDownList ID="DropDownList1" runat="server">
            </asp:DropDownList>
            <asp:DropDownList ID="DropDownList2" runat="server">
            </asp:DropDownList>
        </div>
        </form>
    </body>
    </html>
      

  4.   


      $(function() {          
                var id = $("select").eq(0).attr("ID")
                $("#" + id).append(" <option value='1'>选项1</option>").append(" <option value='2'>选项2</option>").append(" <option value='3'>选项3</option>");
            });   
      

  5.   

    楼上的谢谢哦;
    希望在后台用foreach实现!