S
Stephane
Hi,
I have created dynamically some check box using CheckBoxList. I' trying to
retreive those check boxes values with Request.From but I only get "on" for
checked boxes.
I did the same for radio button using RadioButtonList and droplist and it
works great.
How can I retrieve those values??
Here's how I fill my lists:
ListControl bList;
if (question.AnswerTypeId == SurveyQuestion.RADIO)
bList = new RadioButtonList();
else
bList = new CheckBoxList();
foreach (SurveyAnswer answer in question.AnswersList.Values)
{
ListItem item = new ListItem(" " + answer.Answer, ANSWER_VALUE +
answer.AnswerId.ToString());
bList.Items.Add(item);
}
And this is how I try to retrieve them:
if (this.IsPostBack)
{
for (int i=0; i<Request.Form.Count; i++)
{
Response.Write(Request.Form + "<br>");
}
It prints:
answer_12 // Radio
answer_14 // Radio
on // Checkbox
on // Checkbox
answer_56 // Droplist
I need to get the value instead of the "on".
Any idea?
Thanks
Stephane
I have created dynamically some check box using CheckBoxList. I' trying to
retreive those check boxes values with Request.From but I only get "on" for
checked boxes.
I did the same for radio button using RadioButtonList and droplist and it
works great.
How can I retrieve those values??
Here's how I fill my lists:
ListControl bList;
if (question.AnswerTypeId == SurveyQuestion.RADIO)
bList = new RadioButtonList();
else
bList = new CheckBoxList();
foreach (SurveyAnswer answer in question.AnswersList.Values)
{
ListItem item = new ListItem(" " + answer.Answer, ANSWER_VALUE +
answer.AnswerId.ToString());
bList.Items.Add(item);
}
And this is how I try to retrieve them:
if (this.IsPostBack)
{
for (int i=0; i<Request.Form.Count; i++)
{
Response.Write(Request.Form + "<br>");
}
It prints:
answer_12 // Radio
answer_14 // Radio
on // Checkbox
on // Checkbox
answer_56 // Droplist
I need to get the value instead of the "on".
Any idea?
Thanks
Stephane