zoukankan      html  css  js  c++  java
  • 取repeater里生成的INPUT值

    foreach (RepeaterItem item in dltShiguliebie.Items)
                {
                    string shiguleibie = "";
                    int siwangrenshu = 0;
                    foreach (Control ctl in item.Controls)
                    {
                        if (ctl is HtmlInputText)
                        {
                            if (((HtmlInputText)ctl).Value == "")
                            {
                                siwangrenshu = 0;
                            }
                            else
                                siwangrenshu = Convert.ToInt32(((HtmlInputText)ctl).Value);
                            siwangzongshu = siwangrenshu + siwangzongshu;
                        }
                        if (ctl is Label)
                        {
                            shiguleibie = ((Label)ctl).Text;
                        }
                    }

    <asp:Repeater ID="dltShiguliebie" runat="server">
                <ItemTemplate>
                <tr>
                    <td class="style5">
                        <asp:Label ID="Label1" runat="server" Text='<%#Eval("Shiguleibie")%>'></asp:Label>
                        死亡人数</td>
                    <td class="sctdright">
                    <input id="aa" type="text" name="22" runat="server" onpropertychange="if(!/^\d*(\.\d*)?$/.test(this.value))this.value=this.value.substr(0,this.value.length-1)"/>
                    </td>
                    </tr>
                </ItemTemplate>
               
                </asp:Repeater>

  • 相关阅读:
    第二阶段第二次spring会议
    第一次冲刺阶段的改进方案
    第二阶段第一次spring会议
    第七次spring会议
    第六次spring会议
    第五次spring会议
    第四次spring会议
    第三次spring会议
    第二次spring会议
    第一次spring会议
  • 原文地址:https://www.cnblogs.com/windphoenix/p/1646633.html
Copyright © 2011-2022 走看看