Problem rendering child controls when creating a custom control library

Discussion in 'ASP .Net' started by Scott Yenor, Jan 22, 2004.

  1. Scott Yenor

    Scott Yenor Guest


    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

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

    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">
    <%= DateTime.Now; %>

    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.


    Scott Yenor
    Scott Yenor, Jan 22, 2004
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.