你可以通过ajax来实现,网上搜下

解决方案 »

  1.   

    或者你在某个页面用document.write的方式输出,然后在html页面里用<script src="xx.aspx"></script>这样的方式调用,不过这么做的话要注意需要转义的字符
      

  2.   

    可以给点具体的代码提示吗
    我看过书上的AJAX类似的例子,可是做起来没效果
      

  3.   

     <script src="xx.aspx"> </script>实在不行你就用这个模式吧首先你服务器必须支持NETxx.aspx在这个页面你最后用document.write输出比如response.write("document.write('nihao')")
      

  4.   

    chinmo我按照你的方法这样试了一下,没有结果输出,是哪里有什么问题吗?
    这是html源代码
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>无标题页</title>
    </head>
    <body>
    here:<script type="text/javascript" src=“test2.aspx”></script>
    </body>
    </html>
    这是aspx.cs代码
    public partial class test2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write("document.write('nihao')");
        }
    }
      

  5.   

    public partial class test2 : System.Web.UI.Page 

        protected void Page_Load(object sender, EventArgs e) 
        { 
            Response.Write("document.write('nihao')"); 
        } 

    这里有问题啊
    Response.Write("document.write('nihao')");
    response.end();
    这样试一下