Problem rendering child controls when creating a custom control library


S

Scott Yenor

Hello,

I am writing a control library that has a control that inherits from
System.Web.UI.Control. The control works fine and I am able to loop
through the child controls and display everything fine until I try to
put some ASP.NET processing code in-between the tags.

For example:

This works fine. The control executes and displays everything just
fine.

<myctl:Zone Class="myclass">
<P>
Some child controls between my custom control.
<P>
</myctl:Zone>

The following doesn't work. The control executes, but when I try to
display the child controls, they don't seem to exist. I have checked
the value of the IsLiteralContent and have found that on the above
example, the IsLiteralContent is true, but on the following example,
it is false.

<myctl:Zone Class="myclass">
<P>
<%= DateTime.Now; %>
</myctl:Zone>

I haven't been able to find anything about getting the code to process
before the custom control processes. How do I get this to work? Is
there a way to get the ASP processing block to process before the
control class does its rendering so the content is a literal control?

Please help. I have spent too much time trying to figure it out.

Regards,

Scott Yenor
 
Ad

Advertisements


Top