Issues in ASP.NET 2.0 when dynamically loading user controls or asp.net web controls???

B

Bob Rock

Hello,

I'm new to ASP.NET and I've been looking into the topic of dynamically
loading (typically accomplished with a LoadControl followed by a
MyControl.Controls.Add()) both user controls and asp.net web controls. I
searched for articles on the internet and in the end I must say that I'm
confused.
I read about issues related to:

a.. events not firing
b.. state management
c.. postbacks
but a lot of these articles were old, dealing with v1.1 or even v1.0 of the
framework so I really don't know if any of these issues still exist and what
they are. I know however that Microsoft used this technique of dynamic
controls loading in the old IBuySpy portal starter kit ..... so I maybe it
is not so bad.

Could anyone please briefly recap if any issues still exist in ASP.NET v2.0
when dynamically loading user controls (.ascx) and/or asp.net web
controls???
Thanks.


Bob Rock
 
C

Cowboy \(Gregory A. Beamer\)

The majority of issues related to dynamic loading of controls deal with
users loading controls at the wrong time in the cycle. You have to know when
to load the control, depending on what you are doing. ViewState, for
example, loads after Init, but before Page_Load. Depending on how you use
the control, you might have to bind in Init instead of Page_Load.

Are these "problems" still extant in 2.0? Yes, because so few people
actually read about the page lifecycle and do it properly.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
 

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,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top