日期:2014-05-17  浏览次数:20569 次

在页面中嵌如这样的代码 Response.Write("<script>alert('hello');</script>");
<script runat="server">
    protected override void OnLoad(EventArgs e) {
       Response.Write("<script>alert('hello');</script>");
    }
</script>
这样的代码在没有codebehind的aspx页面里无法编译,因为Response.Write里有</script>标签,
请问怎么才能用

------解决方案--------------------
我是新手,不太明白你为啥这么写,一般我Response.Write都放在后台cs中用,前面js不是一般都写window.open或者showModalDialog()之类的吗 
------解决方案--------------------
你都CODEFILE了,干嘛还要编译,直接用就可以了!
------解决方案--------------------
Response.Write("<script>alert('hello');<");
Response.Write("/script>");
这样可以吧?