PDA

View Full Version : ASP / VBScript question



Kyle
12-02-2003, 02:22 PM
If I have <HTML Tags> stored in a record in my database, but I want them displayed as regular text on a page how would I do this?

The record has like <head> tags in it. These tags get treated as HTML code and aren't able to be displayed on the page as written text.

Any advice? Anyone need clarification?

Thanks!

GCT13
12-02-2003, 03:17 PM
If I understand you correctly string replace the carrots ">" & "<" into their corresponding html characters:

theString = Replace(htmlCode, "<", "&lt;")
theString = Replace(theString, ">", "&gt;")

Hope that helps.

flyingpylon
12-03-2003, 11:35 AM
I think what you want is Server.HTMLEncode("string").