SolutionCottage.com
Posted  20 Mar 2009 - 10:16:07

Category: ASP.net


Use double quotes in server tag on an ASP.net page

Issue:
You want to have double quotes in a server tag in an ASP.net page. Maybe something like:

InvalidChars="`~!@#$%^&*()_-+=[]{}:;'\",.<>/?"

Note the escaped double quotes \" at the end of the string. This will not work and give an error message on runtime.

Solution:
Use the encoded html string for the character you want, in this example:

InvalidChars="`~!@#$%^&*()_-+=[]{}:;',.<>/?&#34;"

The double quotes character corresponds to &#34; in this example.



Marked as helpful by 1 user




1 comment:

10/21/2013 3:35:02 PM  Nabil  wrote:

Thanks! this helped a lot, I suggest if you use a table with forbidden characters and their correspondances in html.









© SolutionCottage 2008-2011 7/21/2017 3:32:23 AM