Access selected items' (ListItems) VALUES of dynamically generated CheckBoxList on postBack
When I dynamically create CheckButtonList, I add ListItem(s) to my
CheckButtonList object chkList
chkList.Items.Add(new ListItem("My Text", "My Value"));
The resulting HTML doesn't contain value="My Value". Therefore, I can't
access "My Value" with Request.Form on post back.
I do get the desired outcome with my RadioButtonList object radioList when I
radioList.Items.Add(new ListItem("My Text", "My Value"));
because for RadioButtonList, I get "My Value" in html.
How can I make it work for CheckBoxList? What I am trying to achive is to
get the values associated with checked items of my dynamically generated
CheckBoxList through Request.Form. I could do it with RradioButtonList but
not with CheckBoxList. I don't want to have to persist my dynamically
generated CheckBoxList into Session.
|All times are GMT. The time now is 11:49 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.