Reputation: 3571
In VB.NET Label,
lblNotification.Text = send email to <[email protected]> me
O/P I am getting as send email to me
and it not displays the <[email protected]>
. How to display the full text including angular brackets. That is, I need to get the O/P as send email to <[email protected]> me
. Thanks.
Upvotes: 2
Views: 2480
Reputation: 5340
Use the following code:
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
MyBase.OnLoad(e)
Label1.Text = HttpUtility.HtmlEncode("send email to <[email protected]> me")
End Sub
The HttpUtility.HtmlEncode method will automatically convert your string to html encoded text
Upvotes: 4
Reputation: 6079
You can use the < and > like below
<asp:Label runat="server" ID="lblNotification" Text="send email to
&lt;[email protected]&gt me;" />
Upvotes: 1
Reputation: 18649
You can use <
instead of <
and >
instead of >
. So your text should be send email to <[email protected]> me
Upvotes: 2