A
A
Atlant1Q2018-02-28 18:08:44
HTML
Atlant1Q, 2018-02-28 18:08:44

String conversion when getting from the database, how to fix it?

The table in the database stores a string with an html page, for example:
\r\n"-//W3C//DTD XHTML 1.0 Transitional//EN\"
after I pull it out using ExecuteScalar(), the following appears in the string:
" \\r\\n\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\"
how to disable this "auto-escaping"?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
cicatrix, 2018-02-28
@cicatrix

ExecuteScalar will give you exactly what is stored in the database. Screening, apparently, occurs later.
If you are writing in Razor use Html.Raw(your string)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question