Label Text Property and entities

  • Thread starter Thread starter Rene
  • Start date Start date
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.
 
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/
=========================
 
Back
Top