quot to " in MVC
本文关键字:quot MVC in amp to | 更新日期: 2023-09-27 18:19:17
样本
<script>
$('#data').jstree({
'core': {
'data': [@:{"text" : "ABC"}, @subtree();]}})
@function {
public string subtree(){
return "{'"text'" : '"ABC'"}, "
}
}
</script>
会变成
$('#data').jstree({
'core': {
'data': [{"text" : "ABC"},{"text" : "ABC"},]}})
我需要输出quot
。我需要函数递归。我怎么解它?
由于@subtree();
调用的字符串输出是自动转义的,您应该通过调用Html.Raw
:
'data': [@:{"text" : "ABC"}, @Html.Raw(subtree());]}})