Suppose I have following string:
var myString="<ol>\r\n<li>Some text</li>\r\n</ol>";
when I am trying to alert(myString) everything is ok but,
Suppose I have Model:
public class MyModel
{
public string TestProperty{get;set;}
}
In controller I am setting TestProperty=myString
in view :
@model MyModel
<script>
jQuery(document).ready(function() {
alert('@Model.TestProperty')// here I am getting error Uncaught SyntaxError: Unexpected token ILLEGAL
})
</script>
I cant figure out what is the problem ,and how to fix it . Thanks a lot for your attention.