Confusion Over Postback, ViewState and Dynamically Added Controls

G

Guest

Hi there:

I've checked the forums, but haven't found a situation addressing my
specific problem. Here's the deal:

I've got a Web Form containing two Panel controls. One displays search
results in a DataList comprised mainly of LinkButtons. The other's basically
empty; it's intended to handle a collection of dynamically added controls.

When the user clicks a LinkButton from within the first Panel control, I
want to be able to take the argument passed by that click and add, to the
second Panel control, an IFRAME tag with a reference to load from a URL based
on what the user clicked. This panel should be able to contain one 'n'
IFRAME tags.

The problem I'm having is that with each PostBack, the Panel that's supposed
to contain the "Controls.Add"-ed IFRAME tags only contains the one requested
by the most recent PostBack. Instead of creating the running, cumulative
collection of IFRAMEs with each LinkButton click that I'm looking for, the
Panel dumps everything and starts over with what was just requested.

I understand this probably has something to do with Page.Load and ViewState,
but I'm unclear as to how to address it specifically. Please help!

Thanks much,
Chris
 

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,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top