Hi All I'm going to generate an asp:CheckBoxList using this code
<%
System.Collections.Generic.List<QuizzEngine.Common.Question> qList = (System.Collections.Generic.List<QuizzEngine.Common.Question>)Session[QuizzEngine.Common.SessionKeys.QuesionsList];
int navigator = (int)Session[QuizzEngine.Common.SessionKeys.Navigator];
if (**True**)
{
%>
<'asp:CheckBoxList ID="cblistAnswers" runat="server"
<'Width="139px"style="text-align: left" AutoPostBack="False">
<'asp:ListItem Value="1">Me<'/asp:ListItem>
<'/asp:CheckBoxList>
<%
cblistAnswers.Items.Clear();
foreach (QuizzEngine.Common.Answer answer in qList[navigator].QuestionAllAnswers)
{
ListItem i = new ListItem();
i.Attributes.Add("runat", "server");
i.Value = answer.AnswerId.ToString();
i.Text = answer.AnswerText;
cblistAnswers.Items.Add(i);
}
%>
Only the ListItem I added in the markup
(<'asp:ListItem Value="1">Me<'/asp:ListItem>)
appears, the other items I added dynamically doesn't appear, what I should do??