Access selected items' (ListItems) VALUES of dynamically generated CheckBoxList on postBack

Discussion in 'ASP .Net' started by Boris, Apr 17, 2005.

  1. Boris

    Boris Guest

    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
    Boris, Apr 17, 2005
    #1
    1. Advertising

  2. Boris

    binusworld

    Joined:
    Sep 30, 2008
    Messages:
    1
    dynamically generated CheckBoxList value on postback

    hi Boris,

    Do you manage to get past this issue. I am facing something similar...

    thanks
    Binu
    binusworld, Sep 30, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric Robishaw
    Replies:
    1
    Views:
    4,340
    Victor Garcia Aprea [MVP]
    Dec 27, 2003
  2. Patrick.O.Ige
    Replies:
    5
    Views:
    19,103
    Patrick.O.Ige
    Jun 19, 2005
  3. Bart Van Hemelen
    Replies:
    2
    Views:
    4,666
    Bart Van Hemelen
    Sep 4, 2006
  4. Replies:
    4
    Views:
    2,651
  5. Amelyan
    Replies:
    0
    Views:
    222
    Amelyan
    Apr 17, 2005
Loading...

Share This Page