有两个页面,一个htm,一个ASP.Net。
现在我用ASP.Net 后台调用htm里面的里面的js函数????? 

解决方案 »

  1.   

          。调用HTML的没试过 。调用JS文件里面的天天在用 。你不如把HTML分离。 嘿嘿 。 现在开发嘛。 要求越简单 越好。    
      

  2.   

    <!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>
    <script>
    function tt(){alert(1)}
    </script>
    </body>
    </html>
    default.aspx protected void Page_Load(object sender, EventArgs e)
        {
            System.Net.WebClient wc = new System.Net.WebClient();
            string s = wc.DownloadString("http://localhost:2528/WebSite1/1.htm");
            System.Text.RegularExpressions.Regex re=new System.Text.RegularExpressions.Regex("<script[^>]*>[^<]*<\\/script>",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
            string functions="tt";//函数名
           System.Text.RegularExpressions.MatchCollection mcl= re.Matches(s, 0);
           for (int i = 0; i < mcl.Count; i++)
           {
              Response.Write(mcl[i].Value);
           }
           Response.Write("<script>" + functions + "();</script>");
        }弹出1