database storing > as it's html equivalent

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

While i save a record the database stores the character > as it's html
equivalent which is >. But when i update that record it saves the character
as > itself. Why would this happen?
 
Prisy,

That doesn't sound like a database error, rather, it sounds like you are
getting in HTML encoding, and storing the record as that, not decoding the
string before you place it in the database.

Where are you getting the string from?
 
Hi Nicholas,

Thank you for your quick response. I figured out the answer to the problem.
The value is from a text area. Originally my code was as follows:

name = txtName.Value;

Instead either of the below will work:

name = txtName.InnerText;
or
name = Server.HtmlDecode(txtName.Value);

--
Thanks
Prisy


Nicholas Paldino said:
Prisy,

That doesn't sound like a database error, rather, it sounds like you are
getting in HTML encoding, and storing the record as that, not decoding the
string before you place it in the database.

Where are you getting the string from?
 
Back
Top