Dear reader,
My question is, i have several checkboxes on my page, those checkboxes have different backcolors, how can i find with c# code, de backcolor of a chek box when he is checked.
My code so far is,
foreach (var control in this.Controls) //find control
{
if (control is CheckBox) // if control is a checkbox
{
if (((CheckBox)control).Checked) //if checkbox is cheked
{
// find backcolor of checked checkbox
// write name of backcolor to database
conn.Open();
SqlCommand cmd2 = new SqlCommand("INSERT INTO UserOrder(Name, Price, UserId, Url, Color ) values(@Naam, @Prijs, @UserID, @Url, @Color)", conn);
cmd2.Parameters.AddWithValue("@Naam", chb.Text);
cmd2.Parameters.AddWithValue("@Prijs" ...
Go to the complete details ...