Welcome to WebmasterWorld Guest from 50.17.74.162

Forum Moderators: ocean10000

Message Too Old, No Replies

Adding html tags to string

SQL output to web

     

LinuxGold

4:30 pm on Nov 14, 2005 (gmt 0)

10+ Year Member



I use SQL output to create a drop-down list and to validate my web page. I'm trying to figure out a way to convert special chars into html code i.e. & to & and so on. What is the ASP syntax that I should use to do so? My current code is:


<tr>
<td><% response.write rs.fields(1).Value%></td>
</tr>

emsaw

9:27 pm on Nov 14, 2005 (gmt 0)

10+ Year Member



You could try:

<% response.write Server.HTMLEncode( rs.fields(1).Value ) %>

HTH,

Mark

LinuxGold

12:34 pm on Nov 15, 2005 (gmt 0)

10+ Year Member



Thanks! Is there any list of ASP utilities like Server.HTMLEncode() on site that I can use?

Thanks,

Scott

LinuxGold

6:09 pm on Nov 15, 2005 (gmt 0)

10+ Year Member



Ah, what about %20 for space? Server.HTMLEncode doesn't do that ... To prevent deformed anchor links.

Dijkgraaf

8:54 pm on Nov 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For URL's use Server.URLEncode()
 

Featured Threads

Hot Threads This Week

Hot Threads This Month