Dynamic controls and event wiring

G

Guest

To wire a Click event handler to a dynamically-added control (e.g.
LinkButton), you need to do so during the Load event of the parent (e.g. a
PlaceHolder).

The problem is, the Click event handler sets up a member variable that needs
to control how the dymanic controls are created in the first place!

Alas, I can't do so because it's already too late since the Load event fires
before the Click event.

Wiring the Click event handler during the PreRender event of the parent
doesn't work.

I played around with the idea of using positional static controls and
dynamically setting their Visible and Enabled properties, but it turned out
quite messy.

Is there a way to work around this problem.

I appreciate your feedback.
 

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

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top