Get rid of the & quot; tags
-
I have a string which contains something like this
strTest = "alert(\"test\")";
When i want to add this to a onclick event of a button for client-side action, i do this the following way:btnTest.Attributes.Add("onclick", testStr);
This all works fine but when i look at the HTML code it is rendered to this: (Without the spaces between & and quot) There are & quot; tags rendered for the \" chars. But i want just that it is rendered like \" because it is sexier and less code to send to the client. Can someone help me with this. BTW, people will answer that i should use ' characters. But i also want to register some XML as an parameter of an javascript function. XML uses " chars and these are all rendered as & quot; So i want also this to be rendered like \" or i want a way to get " in the XML rendered like \' to the client Thanx