homepage Welcome to WebmasterWorld Guest from 54.204.141.129
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Adding html tags to string
SQL output to web
LinuxGold




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

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




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

You could try:

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

HTH,

Mark

LinuxGold




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

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

Thanks,

Scott

LinuxGold




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

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

Dijkgraaf




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

For URL's use Server.URLEncode()

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved