c# - checkboxlist items as checked by default in codebehind asp.net -
I have the checkbox list
in my page and I have 7 items. I 7 would like to set items as checks in their Page_load
codebihind.
My page:
& lt; Asp: checkbox list id = "weekly condition" runat = "server" & gt; & Lt; Asp: ListItem value = "1" & gt; Sat & lt; / Asp: ListItem & gt; & Lt; Asp: ListItem value = "2" & gt; Sun & lt; / Asp: ListItem & gt; & Lt; Asp: ListItem value = "3" & gt; Mon & lt; / Asp: ListItem & gt; & Lt; Asp: ListItem value = "4" & gt; Mars & lt; / Asp: ListItem & gt; & Lt; Asp: ListItem value = "5" & gt; Mercury & lt; / Asp: ListItem & gt; & Lt; Asp: ListItem value = "6" & gt; Guru & lt; / Asp: ListItem & gt; & Lt; Asp: ListItem value = "7" & gt; Venus & lt; / Asp: ListItem & gt; & Lt; / ASP: CheckBoxList & gt;
If you want to see some of them with some condition, Some can use this:
Protected Zero Page_Load (Object Sender, EventArgs E) {for (int i = 0; i
to
Comments
Post a Comment