Composite Control - Capturing post back when controls change

Discussion in 'ASP .Net Web Controls' started by Darvin Zuch, Dec 28, 2003.

  1. Darvin Zuch

    Darvin Zuch Guest

    Hi All,

    I'm writting an exam control that reads an xml doc and
    displays the questions.

    I have a single submit button and a number of radio
    buttons. I'm using CreateChildControls to create the
    controls.

    When I click the button and it fires the ButtonClicked
    event. ie "AddHandler button1.Click, AddressOf
    Me.ButtonClicked" but because I draw the next question on
    a page refresh, the control array may be different and so
    the clicked event doesn't always fire.

    How do I design around this?

    Darvin Zuch
    Canada
     
    Darvin Zuch, Dec 28, 2003
    #1
    1. Advertising

  2. Darvin Zuch

    Jos Guest

    Darvin Zuch wrote:
    > Hi All,
    >
    > I'm writting an exam control that reads an xml doc and
    > displays the questions.
    >
    > I have a single submit button and a number of radio
    > buttons. I'm using CreateChildControls to create the
    > controls.
    >
    > When I click the button and it fires the ButtonClicked
    > event. ie "AddHandler button1.Click, AddressOf
    > Me.ButtonClicked" but because I draw the next question on
    > a page refresh, the control array may be different and so
    > the clicked event doesn't always fire.
    >
    > How do I design around this?
    >
    > Darvin Zuch
    > Canada


    Always recreate the same controls on postback, then
    handle the events, then destroy the controls that you don't
    need and create new ones.

    --

    Jos
     
    Jos, Dec 28, 2003
    #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. Lucas Tam
    Replies:
    1
    Views:
    740
    John Saunders
    Aug 17, 2003
  2. sleigh
    Replies:
    1
    Views:
    2,694
    sleigh
    Feb 12, 2004
  3. =?Utf-8?B?Z29yaWxsYQ==?=
    Replies:
    1
    Views:
    775
    Masudur
    May 25, 2007
  4. Chad
    Replies:
    0
    Views:
    225
  5. Mike

    Composite vs non composite Controls

    Mike, Mar 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    266
    Sundararajan
    Mar 11, 2005
Loading...

Share This Page