I'm having few checkboxes which are dynamically created using c# code- behind. At client side using jquery I want to make the checkbox as checked, but the checked value is not reflected on the UI. I have browsed for the solution and it suggest something related to VIEWSTATE. Here is my C# code and Jquery where I'm setting the Checkbox value.
C#. Code
CheckBox checkbox = new CheckBox();
checkbox.ID = "CheckBox" + i++;
checkbox.InputAttributes["class"] = "skin-line-grey icheck-label form-label";
checkbox.ClientIDMode = ClientIDMode.Static;
checkbox.Text = item.Text;
PnlEventList.Controls.Add(checkbox);
Jquery. Checkbox1 is the ID for checkbox been dynamically created. Same I have 7 more checkboxes.
$('#CheckBox1').prop('checked', true);