Shortcuts

Server Control and SetRenderMethodDelegate

I have run into a problem with my server control and am unable to find any answers on the web. I have written a control that we use to generate web reports. I have overridden the Render and RenderChildren methods to ensure that it renders child controls in
a specific order and only under certain conditions (for instance, it won't render the criteria form and validation code if the user is downloading to Excel). It looks something like this:

// this code block is intended to be a literal control of client-side JavaScript code.
if (form.City.value == "")
{
alert("You must select a city.");
}

Obviously there is more, but you get the point. If the report is downloaded to Excel, then the Report control will not render the Criteria control or the Validation control. My problem is that if I put rendered code inside the server controls, the compiler sets the RenderMethod delegate instead of placing that code inside its own literal control. So if I do this:

if (form.Year.value != )
{
alert("You must select a date in the current year.");
}

then I expected Validation to contain 3 child controls: the LiteralControl up to the , and a LiteralControl containing everything after the %>. Instead, the compiler creates its own __Render__ctlValidate function that contains an output.Write statement for what I thought would be three literal controls and calls SetRenderMethodDelegate(__Render__ctlValidate) inside the __BuildControl__ctlValidate function. This means that when my Validation control renders itself, then nothing is displayed because my Render function is only looking for child controls.
I should note that if I don't add the in there, it works great. Also, I have found a way around this. If I put my code inside a PlaceHolder control like this:
then it solves my problem... my Validate control ends up with 3 child controls (2 literals, 1 placeholder) and renders correctly. The aspx compiler sets the RenderMethod delegate on the PlaceHolder control instead of on my validate control, but I can't accept that there's not a better way.
Has anyone run into this problem before and is there a better way to handle this? Is there a way to tell the aspx compiler to create a child LiteralControl with my rendered code block instead of setting the render delegate?
Additional note:
This also tells me that the base Control.RenderChildren actually does more than just this (which I've seen in MSDN as an example):

Re: Server Control and SetRenderMethodDelegate

Yeah, that's the problem. We have a lot of developers that have used ASP forever, so I tried to make it as easy as possible to convert from ASP-JScript to .NET/C#. They'll already have the shock of having to use typed variables (I am a C++ programmer so I love
C#, but they have not been trained in that arena), so I was trying to keep the difficulty to a minimum. I want my control to do most of the "work" behind the scenes, but the overall structure of the page can still look similar to what they are accustomed to
doing. I will probably just take your advice and use Literal.Text for instances like this, but I can't see why it wouldn't automatically turn