Forum Moderators: open

Message Too Old, No Replies

not evaluate html from sql

         

bouy

7:11 pm on Jul 19, 2006 (gmt 0)

10+ Year Member



quick question..I have some html in an mssql db and i want to response.write it without the tags being evaluated (eval as text)....?

bouy

7:12 pm on Jul 19, 2006 (gmt 0)

10+ Year Member



p.s. classic asp

aspdaddy

8:03 pm on Jul 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The only way I found was to write it inside code tags and replace < with "&lt;" and > with "&gt;"


Response.write "<code>&lt;p&gt;A TEST PARAGRAPH&lt;/p&gt;</code>"

Brad_H

8:30 pm on Jul 19, 2006 (gmt 0)

10+ Year Member



You can use Server.HTMLEncode to do this.

Response.Write(Server.HTMLEncode( Db-Variable-Here ))

bouy

10:59 pm on Jul 19, 2006 (gmt 0)

10+ Year Member



sweet..thanks