• 取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>

  • 相关阅读:
    SQL学习日志
    程序员之路──如何学习C语言并精通C语言
    using用法
    c#中的接口与类的区别
    用c#来实现一种行列式的计算优化
    python 切换目录
    如何光盘自动运行html?
    nsis 安装脚本示例(转)
    python sys.path.append
    python 面向对象初认识
  • 原文地址:https://www.cnblogs.com/windphoenix/p/1646633.html
Copyright © 2020-2023  润新知