日期:2014-05-16  浏览次数:21334 次

asp怎样动态获取在页面输入的每个<input type=text>的value
<asp:Repeater ID="Re_bookCar" runat="server">
  <ItemTemplate>
    <tr>
      <td class="td1">
        <%#pds.PageSize * pds.CurrentPageIndex + Container.ItemIndex + 1%>
      </td>
      <td class="td2">
        <%#Eval("bookType")%>
      </td>
      <td class="td2">
        <%#Eval("name")%>
      </td>
      <td class="td2">
        <%#Eval("price")%></td><td class="td2"><input id="BookCount" name="BookCount" runat="server" class="input" maxlength="4" onfocus='onFocus(this,"请认真填写当前书籍的数量。","mess_hint");' onblur="onBlur(this,'书籍数量不能为空','mess_hint');" value="1" style="width: 30px; font-size: 12px; text-align: center; margin-left: 15px;" />
      </td>
      <td class="td1">
        <a href='javascript:del(<%#Eval("id") %>,1)'>删除</a>
      </td>
    </tr>
  </ItemTemplate>
</asp:Repeater>

------解决方案--------------------
string BookCount=Request["BookCount"];
if(!string.IsNullOrEmpty(s)){
  string []arr=BookCount.Split(',');//这个数组就是对应书输入的数量
}

------解决方案--------------------
foreach(var bookcount in Request.Form["BookCount"]){}