Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do i use certain charcters when writing out asp?

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH
How can I write out a < or > and a &quot; in asp, if were like displaying sourcecode?
 
Hi

Try using
Code:
&lt;
and
Code:
&gt;

(less than and greater than) Derren
[Mediocre talent - spread really thin]
 
no, i mean how do you write out the chr > so it views in the browser as > but I need to write it in ASP... the chr code in html is & g t ; no spaces ...that is = &quot;>&quot;

One other question, how do you get the total count of items in an aray?
 
D'oh! I did put the ampersand codes in but it formatted them as the symbols!

Use &quot;&lt;&quot; and &quot;&gt;&quot; Derren
[Mediocre talent - spread really thin]
 
Create your own chr page

For i = 1 To 256
Response.Write(i & &quot; &quot; & CHR(i) & &quot;<br>&quot;)
Next

This will give you a look up table for your codes

ie x = 62 = &#x; = &#62;

&#Number; will output the character;
 
Oh I think the other one is 60 and &quot; is 34
&# 60 ; &#60;
&# 34 ; &#34;
 
it does write out all the chr's but i get this error at the bottom

Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'chr'
/vzio/test/chr.asp, line 4
 
Look! I am having some serious troubles trying to get these codes to view! They look OK in the preview, then change!

Use

&
lt;

&
gt;

ampersand g t semicolon
ampersand l t semicolon

Display properly you bugger! Derren
[Mediocre talent - spread really thin]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top