Access selected items' (ListItems) VALUES of dynamically generated CheckBoxList on postBack
- From: "Boris" <bamelyan@xxxxxxxxx>
- Date: Sat, 16 Apr 2005 23:18:29 -0500
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
do
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.
Thank you,
-Boris
.
- Prev by Date: Re: the membership of asp.net2.0 is useful in my case?
- Next by Date: Enterprise Library Security block in ASP.NET
- Previous by thread: Re: Is MCAD.NET cert based on VS2003 still worth to take?
- Next by thread: Enterprise Library Security block in ASP.NET
- Index(es):