Answer the question
In order to leave comments, you need to log in
Converting strings in c# to be processed correctly in javascript?
How can I convert a string so that it is exactly passed as a parameter to a javascript function? Here is an example, code on ASP.NET MVC3
@{
string xparam="xyz'><\"<!-- 12 -->abc";
}
<img src="x.png" onclick="myfunction('@xparam')" />
Answer the question
In order to leave comments, you need to log in
I think he wants to cancel auto-screening. To do this, you need to use Html.Raw().
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question