Home All Groups Group Topic Archive Search About

add dynamically multiple controls into one panel

Author
29 Dec 2005 11:25 PM
Adriano
Hi,
With ASP, I can add user contrlos inside the same Panel and then
programmatically change the view state of each one...but I don't want to have
all the controls allready loaded into the Panel when the page starts, instead
I want to call each control (from outside the page) as needed. I have tried
to declare the control class and then programmatically load and change the
view state but it din't work...

Any suggestion in how to better deal with many constrols to the same
panel/page ?

Thanks,

Adriano

Author
30 Dec 2005 12:09 AM
Mike MacMillan
Adriano,
  one thing to keep in mind when building composite controls is to make
sure the child controls exist before the LoadViewState event (such as
in the OnInit event) so their viewstate value is mapped back to them.
if you're providing custom viewstate handling, you'll have to make sure
you're dealing with valid references before mapping their values.

> I want to call each control (from outside the page) as needed

  can you explain this a little more in detail?  how are you calling
them from outside the page?  if you could post a little source code, it
would help diagnose the issue.

  Mike MacMillan



Adriano wrote:
Show quoteHide quote
> Hi,
> With ASP, I can add user contrlos inside the same Panel and then
> programmatically change the view state of each one...but I don't want to have
> all the controls allready loaded into the Panel when the page starts, instead
> I want to call each control (from outside the page) as needed. I have tried
> to declare the control class and then programmatically load and change the
> view state but it din't work...
>
> Any suggestion in how to better deal with many constrols to the same
> panel/page ?
>
> Thanks,
>
> Adriano