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. Advertisements

  2. Boris

    binusworld

    Joined:
    Sep 30, 2008
    Messages:
    1
    Likes Received:
    0
    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. Advertisements

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. =?Utf-8?B?UGV0ZXI=?=

    CheckBoxList contorl's selected items, problem

    =?Utf-8?B?UGV0ZXI=?=, Apr 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    676
    =?Utf-8?B?UGV0ZXI=?=
    Apr 6, 2004
  2. epigram
    Replies:
    4
    Views:
    1,066
  3. Replies:
    1
    Views:
    832
    Damien
    May 24, 2005
  4. Patrick.O.Ige
    Replies:
    5
    Views:
    19,824
    Patrick.O.Ige
    Jun 19, 2005
  5. Bart Van Hemelen
    Replies:
    2
    Views:
    4,895
    Bart Van Hemelen
    Sep 4, 2006
  6. Piotr Strycharz
    Replies:
    0
    Views:
    514
    Piotr Strycharz
    Oct 18, 2006
  7. Replies:
    4
    Views:
    3,304
  8. Amelyan
    Replies:
    0
    Views:
    471
    Amelyan
    Apr 17, 2005
Loading...