Control Builders

J

J.Marsch

I read a little bit about control builders, but I don't exactly understand
them.

In what case would I want to use a builder as opposed to controlling how I
render a control inside of the render method?
 
J

Jacob Yang [MSFT]

Hi Jeremy

A control builder is a class that governs how a server control is parsed
when it is used declaratively on an ASP.NET page.

Based on my research and experience, I would like to share the following
information with you.

Control Builder Overview
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconwebformscontrolbuilderoverview.asp

ControlBuilder Class
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemWebUIControlBuilderClassTopic.asp

Custom Control Builder Sample
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconcreatingcustomcontrolbuilder.asp

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
J

J.Marsch

Jacob:

Thank you for the links, they are very informative. I am still have one
question, though: In what circumstances would I want to choose to use a
control builder, rather than just overriding a control's Render() method?
Said another way, my question is now "Why?", rather than "How?".

-- Jeremy
 
T

Teemu Keiski

Hi,

overriding Render does not correlate any way with using control builders.
Control builders are used when control instances are created from markup
(aspx files parsed) (control builder parses content that exists between tags
of server control) i.e when aspx page is compiled.

Rendering is a way to provide the markup control produces for the browser as
a result of going through a web request. It is not tied to parsing and
compiling a control ( or a page).

--
Teemu Keiski
MCP, ASP.NET MVP
AspInsiders Member, www.aspinsiders.com
ASP.NET Forums Moderator, www.asp.net
AspAlliance Columnist, www.aspalliance.com
 
J

Jacob Yang [MSFT]

Hi Jeremy,

Firstly, I want to thank Teemu's great help in this issue.

In addition, with the ControlBuilder class, we can support our custom tag,
for example <custom: MyCellVB¡­>.

With Render function, we cannot implement this function.

I hope it helps.

Jacob Yang
Best regards,
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top