Adding Literal Controls in CreateChildControls - Is this bad?

Discussion in 'ASP .Net Building Controls' started by KJ, Aug 14, 2003.

  1. KJ

    KJ Guest

    Adding Literal Controls in CreateChildControls - Is this bad?

    Someone told me it was but every example I've seen does not have a
    problem doing it. They told me I should add the html to the page in
    the render method and add the control where I want them to go.

    I just wanted to get other people opinion. Examples or greatly
    appreciated. Thanks
     
    KJ, Aug 14, 2003
    #1
    1. Advertising

  2. KJ

    Teemu Keiski Guest

    Well,

    if thinking it from working solution point, it does work, there's no problem
    but the drawback with the approach are:

    1. You lose ASP.NET's adaptive rendering. If you'd use rendering methods and
    especially HtmlTextWriter's methods and enumerations to output the markup,
    ASP.NET would be automatically capable to adjust the markup based on
    browser.

    2. You increase the size of Control tree. It is not performance wise as
    increased control tree means more processing for the entire Control tree
    (collection).

    But as I said, it works, but with certain things to think about.

    --
    Teemu Keiski
    MCP, Designer/Developer
    Mansoft tietotekniikka Oy
    http://www.mansoft.fi

    AspInsiders Member, www.aspinsiders.com
    ASP.NET Forums Moderator, www.asp.net
    AspAlliance Columnist, www.aspalliance.com


    "KJ" <> wrote in message
    news:...
    > Adding Literal Controls in CreateChildControls - Is this bad?
    >
    > Someone told me it was but every example I've seen does not have a
    > problem doing it. They told me I should add the html to the page in
    > the render method and add the control where I want them to go.
    >
    > I just wanted to get other people opinion. Examples or greatly
    > appreciated. Thanks
     
    Teemu Keiski, Aug 16, 2003
    #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. Arulraja
    Replies:
    3
    Views:
    1,405
    William F. Robertson, Jr.
    Oct 17, 2003
  2. Replies:
    0
    Views:
    498
  3. rantingrick
    Replies:
    44
    Views:
    1,304
    Peter Pearson
    Jul 13, 2010
  4. Hendrik W. Hansen

    Dynamically loading and adding usercontrols after CreateChildControls

    Hendrik W. Hansen, May 28, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    449
  5. Anonieko Ramos

    What's wrong with rpc-literal? Why use doc-literal?

    Anonieko Ramos, Sep 27, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    413
    Anonieko Ramos
    Sep 27, 2004
Loading...

Share This Page