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

how to delimit html markup characters for a web control

P: n/a
I have a code library that I developed in ASP.Net. The code displays in a
web form via a System.Web.UI.WebControls.Label.

It works well because I can search for code snippets and then highlight the
searched results by wrapping color tags around them much like the result
google provides when you search.

However, I tried to save the function I used to perform that action, and it
has characters such as "<", "/" and ">", and the control doesn't display
them. I suppose it's interpreting them as html and applying them to the html
control.

How do I display markup characters in a web control? Is there some sort of
delimiter? I know next to nothing about html.

thanks

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Tim Zych" <tz*************@earthNOSPAMlink.net> wrote in
news:uT**************@TK2MSFTNGP11.phx.gbl:
I have a code library that I developed in ASP.Net. The code
displays in a web form via a System.Web.UI.WebControls.Label.

It works well because I can search for code snippets and then
highlight the searched results by wrapping color tags around
them much like the result google provides when you search.

However, I tried to save the function I used to perform that
action, and it has characters such as "<", "/" and ">", and the
control doesn't display them. I suppose it's interpreting them
as html and applying them to the html control.

How do I display markup characters in a web control? Is there
some sort of delimiter? I know next to nothing about html.


Tim,

Use HttpUtility.HtmlEncode to convert characters like "<", "/" and
">" to their "displayable" equivalents (&lt; for <, &gt; for >, etc.)

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 21 '05 #2

P: n/a
thanks!

"Chris R. Timmons" <crtimmons@X_NOSPAM_Xcrtimmonsinc.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
"Tim Zych" <tz*************@earthNOSPAMlink.net> wrote in
news:uT**************@TK2MSFTNGP11.phx.gbl:
I have a code library that I developed in ASP.Net. The code
displays in a web form via a System.Web.UI.WebControls.Label.

It works well because I can search for code snippets and then
highlight the searched results by wrapping color tags around
them much like the result google provides when you search.

However, I tried to save the function I used to perform that
action, and it has characters such as "<", "/" and ">", and the
control doesn't display them. I suppose it's interpreting them
as html and applying them to the html control.

How do I display markup characters in a web control? Is there
some sort of delimiter? I know next to nothing about html.


Tim,

Use HttpUtility.HtmlEncode to convert characters like "<", "/" and
">" to their "displayable" equivalents (&lt; for <, &gt; for >, etc.)

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.