User controls in a WebForm and pb with state of PlaceHolder

  • Thread starter Yannis CORRE via .NET 247
  • Start date
Y

Yannis CORRE via .NET 247

Hello,

I make 2 Web User Controls (wuc). I want to put them into a WebForm (aspx page).
I drag'n drop the two ascx files into my WebForm.
In one of my wucs, I used a PlaceHolder component to build a table.
I want to switch my 2 wucs by clicking on 2 buttons.

Here the code of the first button :
MyUserControl1.Visible = true;
MyUserControl2.Visible = false;

And the code of the other one :
MyUserControl1.Visible = false;
MyUserControl2.Visible = true;

It works, I but I don't see my table placed in the PlaceHolder.
In fact, the number of controls in the PlaceHolder become zero.

Am I obliged to build my table for each PageLoad ?
Why the PlaceHolder does not do the same thing like a Label for example ? (I see a Label, but not the table)
I thought that the PaceHolder kept the controls for each Visible on/off of my wucs...
So, I have to put the DataSet into a Session variable ?
There is no more issue to make persistent a DataSet ?

Thanks.
 

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,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top