By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,731 Members | 1,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,731 IT Pros & Developers. It's quick & easy.

Literal control rendering empty

P: n/a
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

Jul 30 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Paul wrote:
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
Jul 31 '06 #2

P: n/a
On 30 Jul 2006 17:47:19 -0700, "Paul" <pa*********@gmail.comwrote:
>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
databinding
Peter Kellner
http://peterkellner.net
Jul 31 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.