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>

  • 相关阅读:
    仿百度翻页(转)
    文字顺时针旋转90度(纵向)&古诗词排版
    微信小程序使用canvas绘制图片的注意事项
    PHP即时实时输出内容
    使用Android Studio遇到的问题
    RuntimeError: Model class users.models.UserProfile doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
    drf中的各种view,viewset
    代码审计:covercms 1.6
    windows下安装phpredis扩展
    python练习:异常
  • 原文地址:https://www.cnblogs.com/windphoenix/p/1646633.html
Copyright © 2011-2022 走看看