zoukankan      html  css  js  c++  java
  • select multi option in checkbox group in one time

    Such as:
    there is a checkbox group in a datalist named datalist1. we need to catch the name selected through pressing the button2. the codes is following.
    protected void Button2_Click(object sender, EventArgs e)
        {
            string selectname = "";
            for (int i = 0; i < DataList1.Items.Count; i++)
            {
                bool status = ((CheckBox)DataList1.Items[i].FindControl("CK1")).Checked;
                string username = ((TextBox)DataList1.Items[i].FindControl("TextBox1")).Text;
                if (status)
                    selectname += username+"&";
             }
            Response.Redirect("selectcheckbox.aspx?selectname=" + selectname);
    }
  • 相关阅读:
    inner join on, left join on, right join on讲解(转载)
    ref 与 out
    Shell基础01
    Python 基础01
    linux基础03
    Shell基础02
    linux基础02
    Linux基础01
    linux基础05
    linux基础04
  • 原文地址:https://www.cnblogs.com/Winston/p/1026463.html
Copyright © 2011-2022 走看看