ClientScript.RegisterClientScriptBlock(GetType(Page), "test", <a><![CDATA[
<script type="text/javascript">
testValue = '<%=Page.Title%>';
</script>]]></a>, True)产生;
<script type="text/javascript">
testValue = '<%=Page.Title%>';
</script>发布于 2013-01-24 07:14:25
为了解决这个问题,我用.Value结束了cdata块,并附加了code变量,然后用多行语句的其余部分启动了一个新的cdata块
ClientScript.RegisterClientScriptBlock(GetType(Page), "test", <![CDATA[
<script type="text/javascript">
testValue = ']]>.Value + Page.Title + <![CDATA[';
//more code
</script>
]]>.Value, True)https://stackoverflow.com/questions/13966736
复制相似问题