Groups | Blog | Home
all groups > asp.net building controls > august 2003 >

asp.net building controls : Adding Literal Controls in CreateChildControls - Is this bad?


klj_mcsd NO[at]SPAM hotmail.com
8/14/2003 1:59:47 PM
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
Teemu Keiski
8/16/2003 9:11:52 PM
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


[quoted text, click to view]

AddThis Social Bookmark Button