473,395 Members | 1,464 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,395 software developers and data experts.

HTML encoding method?

hello,

i need to do some HTML encoding on some strings. not UrlEncoding, mind
you, but HTML encoding. ie:

"&" to "&"
"<" to "&lt;"

....etc. does anyone know of a good way to do this, other than manual
string replacements? what of decoding back into plain text?
thanks,
matt

Feb 9 '07 #1
1 1299
HttpServerUtility.HtmlEncode() is what you're looking for. Here's MS
documentation on it:

http://msdn2.microsoft.com/en-gb/library/w3te6wfz.aspx

I just googled [.NET + HTMLEncode] and got over 200,000 links on this... the
above is just one of them

HTH

<ma**@mailinator.comwrote in message
news:11**********************@h3g2000cwc.googlegro ups.com...
hello,

i need to do some HTML encoding on some strings. not UrlEncoding, mind
you, but HTML encoding. ie:

"&" to "&amp;"
"<" to "&lt;"

...etc. does anyone know of a good way to do this, other than manual
string replacements? what of decoding back into plain text?
thanks,
matt

Feb 9 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Damien | last post by:
Hi to all, After hours of attempts and "googling", I'm still pulling my hair off my head when I try to send multipart html emails. It "works" on PCs with Outlook when I juste send a single...
3
by: Marek | last post by:
Hi What I need to do is to take the following XML (or some variant of it): <?xml version="1.0" encoding="UTF-8"?> <MyRawHTML> <H1>Hello, world!</H1> </MyRawHTML> And apply an XSLT to it along...
5
by: Steven Berkovitz | last post by:
Hi there, I am having a problem where if i add an attribute to a control at runtime the rendered attribute is HTML encoded. For example, on a textbox: textBox.Attributes = "if(x && y)...
7
by: | last post by:
Hello, I would like to do the following from a asp.net button click: <form method="POST" action="https://www.1234.com/trans_center/gateway/direct.cgi"> <input type="hidden" name="Merchant"...
0
by: icoba | last post by:
Hi, I am parsing html documents using the html parser from libxml2, and if the encoding is included in the document it works perfectly but if it is not, I think it does not work well (probably...
7
by: KelsMckin | last post by:
What is the easiest way to retreive the html source from a web page? Could you please provide an example? Any and all help would be greatly appreciated
14
by: Zoro | last post by:
My task is to read html files from disk and save them onto SQL Server database field. I have created an nvarchar(max) field to hold them. The problem is that some characters, particularly html...
1
by: Amie | last post by:
Hi, It seems asp.net controls automatically encode the attribute values. For example, I need to have whitespace in OPTION tag. After binding data to the dropdownlist, the source html has the...
2
by: =?Utf-8?B?UGF1bA==?= | last post by:
I am using ASP.Net 2.0 and VB.Net (although C#is ok also). I want to create an object/method/function that will take a URL as an input parameter and then return all of the HTML in that page. I...
5
sid0404
by: sid0404 | last post by:
Hi I am new to the visualstudio.net I am trying to develop an application which requires me to send data to a HTML webpage - http://patft.uspto.gov/netahtml/PTO/search-bool.html and the user...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.