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

Discussion in 'ASP .Net' started by Bob Rock, Sep 17, 2006.

  1. Bob Rock

    Bob Rock Guest

    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
     
    Bob Rock, Sep 17, 2006
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:%...
    > 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
    >
    >
    >
     
    Cowboy \(Gregory A. Beamer\), Sep 17, 2006
    #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. Ben Miller [msft]
    Replies:
    0
    Views:
    615
    Ben Miller [msft]
    Aug 5, 2003
  2. sonic_soul
    Replies:
    0
    Views:
    527
    sonic_soul
    Aug 14, 2003
  3. Nick Stansbury

    loading user controls dynamically

    Nick Stansbury, Jul 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    351
    John Saunders
    Jul 19, 2004
  4. Johnny Fugazzi

    Dynamically loading user controls

    Johnny Fugazzi, Nov 24, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    422
    Johnny Fugazzi
    Nov 24, 2004
  5. Jay Douglas
    Replies:
    5
    Views:
    5,675
    Scott Allen
    Dec 1, 2005
Loading...

Share This Page