add dynamically multiple controls into one panel

Discussion in 'ASP .Net Web Controls' started by Adriano, Dec 29, 2005.

  1. Adriano

    Adriano Guest

    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
    Adriano, Dec 29, 2005
    #1
    1. Advertising

  2. 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:
    > 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
    Mike MacMillan, Dec 30, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry
    Replies:
    3
    Views:
    531
    Harry Singh
    Nov 10, 2003
  2. Chad Scharf
    Replies:
    3
    Views:
    860
    Chad Scharf
    Oct 18, 2007
  3. Paul
    Replies:
    3
    Views:
    3,717
    Ben Amada
    Feb 25, 2009
  4. rifat yavuz
    Replies:
    0
    Views:
    209
    rifat yavuz
    Jul 4, 2008
  5. Sourabh Mhaisekar

    Dynamically Adding Components into Panel

    Sourabh Mhaisekar, May 5, 2013, in forum: Java
    Replies:
    1
    Views:
    213
    Joerg Meier
    May 5, 2013
Loading...

Share This Page