zoukankan      html  css  js  c++  java
  • webform开发经验(一):Asp.Net获取Checkbox选中的值

    webform中获取repeat控件列表下的checkbox选中的值:

    码农上代码:

    public static string getSelectedIDs(Repeater Rpt_)
            {
                string res = string.Empty;
                foreach (RepeaterItem rtpItem in Rpt_.Items)
                {
                    HtmlInputCheckBox obj = rtpItem.FindControl("checkbox") as HtmlInputCheckBox;
                    if (obj != null)
                    {
                        if (obj.Checked == true)
                        {
                            res += obj.Value.ToString() + ",";
                        }
                    }
                }
                if (!string.IsNullOrEmpty(res))
                {
                    res = res.Remove(res.LastIndexOf(','));
                }
                return res;
            }

     

  • 相关阅读:
    poj1087最大流拆点
    3月15上午的函数练习
    3月15
    3月13上午
    3月13
    3月12
    break语句
    3月11
    3月10号
    3月9号
  • 原文地址:https://www.cnblogs.com/benpao/p/3976007.html
Copyright © 2011-2022 走看看