Literal control rendering empty

P

Paul

Hi all,

I have a custom control with an overridden Render method. Inside this
method I'm rendering each control in its collection using their
RenderControl method. However, I'm running into a problem in this
scenario:

<myprefix:mycontrol runat="server">
<%= SomeVariable %>
</myprefix:mycontrol>

The contained control is showing up in the control collection as a
LiteralControl, but its Text property is empty. Well, it's a series of
spaces, so it's not showing up with any content. I can put <%=
SomeVariable %> anywhere outside my custom control and it will render
the variable value correctly.

Is there anything I can do to ensure the variable value is rendered?

I hope this post makes sense!

Thanks,

Paul
 
P

Paul

Does anyone have any ideas?

Does anyone know the term for including server-side variables with the
<%= %> syntax, so I can have better luck searching for answers.

Thanks,

Paul
 

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

Top