I am not able to uncheck a checkbox at first click, on the second click it works fine. I am pretty new to .Net and this is my first time facing it, checking the checkboxes works fine with no issue. I am not able to debug as unchecking the checkbox does not even trigger a page refresh or the event attached to it. This is my code. Please help.
- protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
- {
-
- AllLists create1 = new AllLists();
-
- for (int i = 0; i < rptItemsInCart.Items.Count; i++)
- {
- CheckBox ref_to_checkBox = (CheckBox)rptItemsInCart.Items[i].FindControl("Checkbox1");
- if (ref_to_checkBox.Checked)
- {
- Ok_prompt_to_upload_Button.Visible = true;
- ref_to_checkBox.ID = "Week" + (i + 1);
- Label2.Text = ref_to_checkBox.ID;
- create1.user_select_weeks_list.Add(ref_to_checkBox.ID);
-
-
- }
- else
- {
- create1.user_select_weeks_list.Remove(ref_to_checkBox.ID);
- }
- }
- selected_weeks_repeater.DataSource = create1.user_select_weeks_list;
- selected_weeks_repeater.DataBind();
-
- }
- public class AllLists
- {
- public List<string> user_select_weeks_list { get; set; }
-
- public AllLists()
- {
- user_select_weeks_list = new List<string>();
- }
- }
I don't have anything in my page load, am I missing something.