473,246 Members | 1,446 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,246 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 2137
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
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...

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.