!!!用c#编写浏览器,如何解决网页中“onclick=‘window.open(.....)’”问题

解决方案 »

  1.   

    你的浏览器支持JS脚本了没...查询脚本并执行JS代码.. 很想看看你的浏览器:)
      

  2.   

    你要把这个button设置为服务器控件
      

  3.   

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="JS_Default" %><!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 runat="server">
        <title>无标题页</title>
        <script type="text/javascript">
    //    function OpenWin()
    //    {
    //       
    //    }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <input id="Txt1" type="text" />
            <input id="Button1" type="button" value="button" onclick="window.open('Default2.aspx','_blank')" />
        </div>
        </form>
    </body>
    </html>
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="JS_Default2" %><!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 runat="server">
        <title>无标题页</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <input id="Text1" type="text" />
            <input id="Button1" type="button" value="button" onclick="window.opener.document.getElementById('Txt1').value=document.getElementById('Text1').value;window.close()" />
        </div>
        </form>
    </body>
    </html>
      

  4.   

    content += Regex.Replace(Str, " on.+?=\".+?\"", "", RegexOptions.IgnoreCase);