2014-07-08

Escaping double-quote hell in aspx pages needing single and double quotes within Eval expressions

http://blog.outsharked.com/2010/12/html-apostrophes-quotes.html

If you use Eval inside your ASPX page, you can avoid using escapes for double quotes by using single quotes for the outermost delimiter e.g. href='<%# Eval("mylink") %>'

But, if you really need to escape the inner double-quote characters, you should use the html way of escaping the quote characters i.e. use " inside the html attribute value. e.g. href="<%#  Eval("mylink" )%>"

http://www.ascii.cl/htmlcodes.htm

No comments:

Post a Comment

Github CoPilot Alternatives (VSCode extensions)

https://www.tabnine.com/blog/github-copilot-alternatives/