Label Text Property and entities

R

Rene

The following asp label fail to display in the browser, can someone please
tell me what I am doing wrong. I expect to see the value "<abc>" but instead
I get nothing.

<asp:Label ID="Label1" runat="server" Text="&lt;abc&gt;"></asp:Label>

Thank you.
 
J

Juan T. Llibre

re:
!> I expect to see the value "<abc>" but instead I get nothing.

Try it like this :

<asp:label id="Message1" runat="server"> &lt;abc&gt; </asp:Label>

or... do it programmatically :

Sub Page_Load(obj as object, e as eventargs)
Label1.Text = Server.HtmlEncode("<abc>")
End Sub

<asp:Label id="Label1" runat="server"></asp:Label>




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
=========================
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top