hai,

i am generating check boxes dynamically (code is given below) i wanted to capture the check box checked status plz help me how to do this, dont consider that i have given both text property and ID are same, as this i am testing i have given like that

CheckBox chk;
chk = new CheckBox;
DateTime dt = DateAndTime.DateAdd(DateInterval.Day, 1, date1);
String str = dt.ToString("D");
String[] abc = str.Split(new Char[] { ',' });
Panel1.Controls.Add(chk);
chk.ID=abc[0];
chk.Text=abc[0];
chk.Width=150;
chk.Height=50;

If Possible give me sample example

CheckBox chk = new CheckBox();
        chk.ID = "myChkBox";
        chk.Text = "Click";
        chk.Checked = true;
        Panel1.Controls.Add(chk);
        if(chk.Checked)
        {
            Response.Write("Check box is checked");
        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.