473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

how to delimit html markup characters for a web control

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
2 1128
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: YoBro | last post by:
Hi I have used some of this code from the PHP manual, but I am bloody hopeless with regular expressions. Was hoping somebody could offer a hand. The output of this will put the name of a form...
4
by: Don | last post by:
Using PHP, I'm creating an <input> tag. How do you delimit the text string for the value parm of an <input> tag, when the string contains the delimit char? Example: <input...value="This text...
72
by: Mel | last post by:
Are we going backwards ? (please excuse my spelling...) In my opinion an absolute YES ! Take a look at what we are doing ! we create TAGS, things like <H1> etc. and although there are tools...
18
by: Robert Bowen | last post by:
Hello peeplez. I have an odd problem. When I put the ANSI symbol for "less than" ("<"), the word STRONG and then the ANSI symbol for "greater than" (">") in my web page, followed by some text, then...
7
by: toby989 | last post by:
Hi All Sorry for reposting...the entries of the post from 11/23/2005 by Eric Lindsay have been removed from the server already and I am seeing only the header. So, I have the problem of...
1
by: matt | last post by:
hello, im doing my first experiment w/ RSS & ASP.NET. could use a bit of help. i have a livejournal site blog here: http://nexus9.livejournal.com/ and i have its RSS xml here:
27
by: prt7u | last post by:
Howdy, I've started back afte a very long time of working with web pages for an organization that I am affiliated with (personally not professionally). Seeing that technology has advanced a lot...
2
by: Number 11950 - GPEMC! Replace number with 11950 | last post by:
HTML to RTF conversion is done by the clipboard in certain circumstances. Does anyone know of an API or possibly a Framework2 class.method that will convert HTML to RTF...? TIA -- Timothy...
10
by: annalisa | last post by:
I really need some help with langauge conversion to HTML. My translators are translating into Word and I need to convert Word to HTML. It's been awhile since I've worked with Unicode and know that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.