469,590 Members | 1,949 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,590 developers. It's quick & easy.

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

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

Sep 17 '06 #1
1 1675
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!
*************************************************
"Bob Rock" <ye********************@hotmail.com.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
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

Sep 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by John Richardson | last post: by
1 post views Thread by Sundaresan | last post: by
2 posts views Thread by Vivek Sharma | last post: by
10 posts views Thread by Robert | last post: by
5 posts views Thread by Andrew Robinson | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.