0

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

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by Mohtshm
0

try to use this b4 if loop
v=((CheckBox) o).checked;
then if should be like this
if(v)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.