I'd like to ask what people's experiences are with templating using ASP.NET
I've seen the common method of defining a template class which overrides
Render and inheriting from this.
This method wasn't suitable. First I couldn't get it to work, but also I
wanted to some controls in the early part followed by more template code.
To get round this, my template class has three public methods defined, which
do a load of Response.Write statements. The HTML code then looks something
<& Page ... etc>
<% RenderHeader() %>
<% RenderMid() %>
<% RenderFooter() %>
... and for the most part this works very well. However, there are two main
1. Attempting to add a control in the code behind class doesn't work
becuase of the <% %> tags (at least thats what it tells me)
2. Visual Studio is constantly compaining that when I start a <TABLE>
tag, it doesn't have a parent object (because this is defined in the
As an alternative, does ASP.NET have the facility for placeholders. So I can
define the bare bones of a page (<HTML> <HEAD> tags) which will keep VS
happy and insert various placeholders throughout the page, which when the
page is accessed will render onto the page, maintaining the whole point of
templating which is to make everything consistent and easy to change.
This isn't a massive issue, but I would like to know what others have done
in the past before my site grows too much.