Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

How to render label control code to display in code format instead of control format.

E.g- let take an example of label control i want my output like this
<asp:label ID="lbl" runat="server" />

As a reference stacoverflow and also in codeproject aspx control display as a text with all formatting rather then displaying control.
Posted

1 solution

You need to encode this HTML with HttpServerUtility class. Refer - HttpServerUtility.HtmlEncode[^].
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900