Viewstate and dynamic control

Discussion in 'ASP .Net' started by Mick, Jan 7, 2005.

  1. Mick

    Mick Guest

    Hi,
    Dynamically adding Checkbox and GroupRadioButton (extended control
    http://www.codeproject.com/aspnet/groupradiobuttons.asp) to placeholder.

    In fact, displaying questions and answers.
    When my question as only one good answer, I display RadioButton.
    In the other hand, checkbox.

    Testing my page, I dynamically create controls and checked them if the
    answer is good.
    So, I got all good answers checked (with checkboxes) and selected (with my
    GroupRadiobuttons).
    I submit the form ans ONLY checkbox viewstate is saved, every radiobutton
    checked value is set to false.

    Then, I check AGAIN the good radiobutton and THIS TIME, viewstate works and
    I get 100% / 100% good answers !

    So, here is the point.
    Why does the viewstate is not saving my radiobutton checked value at first
    time ?

    Thks for help ^^
    Mick, Jan 7, 2005
    #1
    1. Advertising

  2. Mick

    Mick Guest

    Yehaa....
    Think to add the control before setting checked value ^^

    "Mick" <> a écrit dans le message de
    news:41de7962$0$31796$...
    > Hi,
    > Dynamically adding Checkbox and GroupRadioButton (extended control
    > http://www.codeproject.com/aspnet/groupradiobuttons.asp) to placeholder.
    >
    > In fact, displaying questions and answers.
    > When my question as only one good answer, I display RadioButton.
    > In the other hand, checkbox.
    >
    > Testing my page, I dynamically create controls and checked them if the
    > answer is good.
    > So, I got all good answers checked (with checkboxes) and selected (with my
    > GroupRadiobuttons).
    > I submit the form ans ONLY checkbox viewstate is saved, every radiobutton
    > checked value is set to false.
    >
    > Then, I check AGAIN the good radiobutton and THIS TIME, viewstate works

    and
    > I get 100% / 100% good answers !
    >
    > So, here is the point.
    > Why does the viewstate is not saving my radiobutton checked value at first
    > time ?
    >
    > Thks for help ^^
    >
    >
    Mick, Jan 7, 2005
    #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. PABruceFan
    Replies:
    3
    Views:
    4,117
    John Saunders
    Jul 31, 2004
  2. Josema
    Replies:
    2
    Views:
    336
  3. Frank

    dynamic control and viewState

    Frank, Sep 10, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    100
    Frank
    Sep 10, 2003
  4. PABruceFan
    Replies:
    3
    Views:
    186
    John Saunders
    Jul 31, 2004
  5. Josema
    Replies:
    0
    Views:
    197
    Josema
    May 9, 2005
Loading...

Share This Page