I have created checkbox as follow
System.Web.UI.WebControls.CheckBox ch = new System.Web.UI.WebControls.CheckBox();
ch.Checked = true;
tc.Controls.Add(ch);
ch.CheckedChanged += new EventHandler(ch_CheckedChanged);//this is my eventhandler
I created a event handler as
protected void ch_CheckedChanged(object o, EventArgs e)
{
string s = Response.Cookies["red"]["re"];
if (v == "true")//i want the state of respective checkbox here to process my if statement
{
if (!pro.Contains(s))
{
pro.Add(s);
dem.Remove(s);
}
else
{
dem.Remove(s);
}
}
else
{
dem.Add(s);
pro.Remove(s);
}
}
i want the state of respective checkbox in variable "v" to process my if statement