Composite Control - Capturing post back when controls change

D

Darvin Zuch

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
 
J

Jos

Darvin said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,085
Messages
2,570,597
Members
47,218
Latest member
GracieDebo

Latest Threads

Top