Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

Problem retrieving HTML from database using .NET webservice

I'm storing HTML pages in a database and retrieving to display in a table.  I'm using a webservice to save/retrieve the data.  The webservice does not like some of the characters in the HTML, so I am using the ESCAPE function in the javascript that saves the HTML to the database, then doing an UNESCAPE to retrieve the data.  The problem is, on the UNESCAPE, my retrieved data (HTML) now has boxes in it and the table will not display the code - I receive an HTML error.  I believe these characters are carriage returns or possibly tabs of some sort, but nonetheless, they are being identified in the unescape.  Has anyone else run into this problem?  Has anyone else ever saved HTML and tried to retrieve it using a webservice?  Thanks !
1 Solution
Can you please provide some more details on your setup?
What web server?
What application server?
What language on the server side?
What database?
Do you mean web service or CGI?
SilveyAuthor Commented:
I'm using ASP .NET, an ASP .NET webservice, SQL Server 7.0, and Javascript.  Thanks!
Sorry, I'm not familiar enough with .NET
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Suppose you were tyring to insert  

hello my "name" is 'Silvey'.  I'm 22 years old.

I wouldn't mess with the javascript excaping and unescaping.

To insert certain characters with asp, you simply double the character. '  becomes ''  " becomes "", etc.

dim text
text = "hello my ""name"" is ''Silvey''. I''m 22 years old."

sql would be  hello my "name" is 'Silvey'. I'm 22 years old.
or sql = "insert into code <html><body><table border=""1"" cellpadding=""0"" cellpadding=""0""><tr><td></td></tr></table></body></html>

b.t.w. those are single quotes around Silvey  ' , the ' ' looks like " when they are together.
A request for deletion has been made.  If no response or you feel this is in error, comment.  If no objection, I will delete in three days.

E-E Admin
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now