日期:2014-05-17  浏览次数:20470 次

下拉框数据绑定问题
jq代码是点击开发人员就添加table,现在的问题是页面是服务端控件,动态加载的是html控件,这两个数据还要一样,请问各位怎么下拉框怎么绑定数据和怎么取数据

Jq代码[code=JScript][/code]<script type="text/javascript">
  $(document).ready(function () {
  $("#but").click(function () {
  var len = $(".hidediv").find("table").get().length;
  var htm = "<table border=\"0\" id=" + (len + 1) + " style=\"background-color: Gray\" style=\"width: 100%\"><tr><td align=\"right\" width=\"15%\">技术负责人:</td><td width=\"15%\"><select id=\"ddlMandateHolders1\" style=\"width: 120px\"><option>请选择</option></select></td><td align=\"right\" width=\"15%\">开发人员:</td><td width=\"15%\"><select id=\"ddlDeveloper1\" style=\"width: 120px\"><option>请选择</option></select></td><td align=\"right\" width=\"8%\">职能:</td><td width=\"25%\"><input type=\"text\" style=\"width: 300px\" id=\"txtTaskContent1\" value=\"\" /></td></tr><tr><td align=\"right\" width=\"15%\">预计开始日期:</td><td width=\"15%\"><input type=\"text\" style=\"width: 120px\" id=\"txtExpectedDtartDate1\" value=\"\" class=\"Wdate\" onFocus=\"WdatePicker()\"></td><td align=\"right\" width=\"15%\">结束日期:</td><td><input type=\"text\" id=\"txtExpectedEndDate1\" style=\"width: 120px\" value=\"\" onFocus=\"WdatePicker()\" /></td><td><a href=\"javascript:void(0);\" onclick=\"deltr('" + (len + 1) + "')\"> 删除 </a></td></tr></table>";
  $("#TbData").show();
  $(".hidediv").append($(htm));
  });
  });
  function deltr(index) {
  $("table[id=\'" + index + "\']").remove();
  }

  </script>[code=HTML][/code] <table border="0" cellpadding="2" cellspacing="1" style="background-color: Gray"
  style="width: 100%">
  <tr>
  <td align="right" width="15%">
  技术负责人:
  </td>
  <td width="15%">
  <asp:DropDownList ID="ddlMandateHolders" runat="server" Width="120">
  </asp:DropDownList>
  </td>
  <td align="right" width="15%">
  开发人员:
  </td>
  <td width="15%">
  <asp:DropDownList ID="ddlDeveloper" runat="server" Width="120">
  </asp:DropDownList>
  </td>
  <td align="right" width="8%">
  职能:
  </td>
  <td width="25%">