1.11M Members

adding checkbox to repeater

 
-1
 

add it in html in repeater

<div id="Div2" class="w200s">
                                <input type="checkbox" id="check" class="basic1" checked= '<%# Eval("arunr")%>' runat="server" disabled="disabled"/>
                                </div>

in code

public class arun
    {

        public string suppid { get; set; }
        public string suppname { get; set; }
        public string dispname { get; set; }
        public bool arunr { get; set; }


    }





List<arun> ss = new List<arun>();
            string connectionString = @"Server=AKBT-TM\SQL2008;Database=us;User ID=sa;Password=turner;";
            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                using (SqlCommand cmd = new SqlCommand("dbo.aruns"))
                {

                    cmd.CommandType = CommandType.StoredProcedure;
                    conn.Open();
                    cmd.Connection = conn;

                    using (SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
                    {
                        while (rdr.Read())
                        {
                            arun n = new arun { suppid = rdr.GetString(0), suppname = rdr.GetString(1), dispname = rdr.GetString(2),arunr=rdr.GetBoolean(3)  };
                            
                            ss.Add(n);
                        }

                        rdr.Close();
                    }
                }
            }
You
Post:
Start New Discussion
Tags Related to this Article