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

Less Than and Greater Than Brackets in Web Pages

I know in regular HTML within a web page, you can use the following to
display < output in the HTML output.

&lt output &gt

but, I'd rather not include any spaces between the less than and great than
signs, thus I want to see <outputinstead. So, I tried using:

&ltappsettings&gt

and only 1/2 of it works. I get the following output instead:

&ltappsettings>

How can I make it so that my output shows as <outputwith no spaces between
the less than sign and the first letter?
Sep 15 '08 #1
4 2143
Greg wrote:
&ltappsettings&gt

and only 1/2 of it works. I get the following output instead:

&ltappsettings>
It should be &lt;appsetting&gt; (note the semicolons).

Try that.
--
Rudy Velthuis http://rvelthuis.de

"Mother-in-law = A woman who destroys her son-in-law's peace of
mind by giving him a piece of hers." -- Anonymous.
Sep 15 '08 #2
Thanks, I literally just tried this a minute ago, and bingo, it works. Thanks.

"Rudy Velthuis" wrote:
Greg wrote:
&ltappsettings&gt

and only 1/2 of it works. I get the following output instead:

&ltappsettings>

It should be <appsetting(note the semicolons).

Try that.
--
Rudy Velthuis http://rvelthuis.de

"Mother-in-law = A woman who destroys her son-in-law's peace of
mind by giving him a piece of hers." -- Anonymous.
Sep 15 '08 #3
"Greg" <Ac**********@newsgroups.nospamwrote in message
news:76**********************************@microsof t.com...
>Greg wrote:
&ltappsettings&gt

and only 1/2 of it works. I get the following output instead:

&ltappsettings>

It should be <appsetting(note the semicolons).

Try that.
Thanks, I literally just tried this a minute ago, and bingo, it works.
Thanks.

"Rudy Velthuis" wrote:
Its unclear whether you are doing this in ASP.NET or not however if not you
can reference the System.Web.dll then you can use:-

string sOut = HttpUtility.HtmlEncode("<appsettings>");

This will save you having to hunt down all the characters that need html DTD
entities such as <, and &.

If you are doing this in an aspx page then the pages Server property can be
used:-

string sOut = Server.HtmlEncode("<appsettings>");

--
Anthony Jones - MVP ASP/ASP.NET

Sep 16 '08 #4
With further research last night I came across this method and it more
appropiately follow the path that I am taking, using ASP.NET pages. Thanks
for the reply.

"Anthony Jones" wrote:
"Greg" <Ac**********@newsgroups.nospamwrote in message
news:76**********************************@microsof t.com...
Greg wrote:

&ltappsettings&gt

and only 1/2 of it works. I get the following output instead:

&ltappsettings>

It should be <appsetting(note the semicolons).

Try that.
Thanks, I literally just tried this a minute ago, and bingo, it works.
Thanks.

"Rudy Velthuis" wrote:

Its unclear whether you are doing this in ASP.NET or not however if not you
can reference the System.Web.dll then you can use:-

string sOut = HttpUtility.HtmlEncode("<appsettings>");

This will save you having to hunt down all the characters that need html DTD
entities such as <, and &.

If you are doing this in an aspx page then the pages Server property can be
used:-

string sOut = Server.HtmlEncode("<appsettings>");

--
Anthony Jones - MVP ASP/ASP.NET

Sep 16 '08 #5

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

Similar topics

4
by: Jeremy Howard | last post by:
Hello everyone, I'm not a database guru so I'm sorry if this is a dumb question but here it goes... I have this sql query that I'm trying to run against a table on a Sql 2k server: SELECT ...
8
by: Al Reynolds | last post by:
Afternoon, I have just finished fixing one of my scripts after it started generating odd errors on IE6 on WinXP Service Pack 2. For info, the IE Version is:...
8
by: Al Reynolds | last post by:
Afternoon, In an earlier thread (http://tinyurl.com/5v4aa), I described a problem I was having which was rather bizarrely solved by changing the line: "inputbox.value = numq+ag-cw-cc;" to:...
14
by: Salad | last post by:
A97. Situation: I have 3 tables with a text field in each and a date field in the first 2 tables: Table1 Text1, Date1 Table2 Text2, Date2 Table3 Text3 (no date field) The following...
15
by: Murt | last post by:
Hi, when writing equations in vb .net, how do you enter the signs "less than or equal to" etc. thanks Murt
11
by: Martin Jørgensen | last post by:
Hi, - - - - - - - - - - - - - - - #include <iostream> #include <string> #include <map> using namespace std; int main() {
16
by: Cory Nelson | last post by:
Does anyone know how std::set prevents duplicates using only std::less? I've tried looking through a couple of the STL implementations and their code is pretty unreadable (to allow for different...
3
by: ek | last post by:
I have the following class: template<typename I> class test { public: test(I i) : pp(i) {} I getpp() const { return pp; }
6
by: ryan.paquette | last post by:
Hello' I am attempting to provide validation for a field on a form through a command. (the validation is only part of the command). The field is a text box formatted as a fixed number... ...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.