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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -