<script>

var bClose = false;
var timeClose = null;

//初始化是打开工作页面
function window.onload()
{
var iW,iH,iS;
iW = screen.availWidth - 10;
iH = screen.availHeight - 50;
strStyle = "directories=no,left=-4,top=-4,location=no,status=1,menubar=0,fullscreen=0,resizable=1,scrollbars=auto,toolbar=no,width=" + iW + ",height=" + iH;
window.open("smMain.aspx","",strStyle);

var n_ver = navigator.appVersion;
if(n_ver.indexOf('MSIE 6.0')>0)
{
window.opener=null;
window.close();         //IE6.0以上(打了SP1EXPRESS)用这种方法关闭,否则不能正常关闭
}
else
{
window.close ();
}
}

function closeWindow()
{
try
{
if (bClose) 
{
txtFocus.focus();
window.clearInterval(timeClose);

Closes.Click();
}
}
catch(e)
{
;
}
}

</script>
这种方法会被上网助手拦截,我要不让上网助手给拦截!
我不知道该怎么办希望大家给我帮助,在此先谢谢了

解决方案 »

  1.   

    不要用脚本window.open打开窗口用Response.Redirect(URL)
      

  2.   

    给你一个Window.open()打开一个窗体不被拦截的例子:
    在DataGrid中建一个模板列,在模板列中放一个客户端的Button,或者直接写你要的字句,然后用<a href>连接
    例:
    <TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" align="center" border="0">
        <TR>
         <TD width="100%">
          <asp:datagrid id="dgFreightInfo" runat="server" Width="96%" GridLines="Horizontal" AllowCustomPaging="True"
           AllowPaging="True" AutoGenerateColumns="False" DataKeyField="id" BorderColor="White" BorderWidth="1px"
           PageSize="20">
           <ItemStyle Height="25px" BackColor="#F7F7F7"></ItemStyle>
           <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Height="25px" BackColor="#E8E8E8"></HeaderStyle>
           <Columns>
            <asp:TemplateColumn>
             <ItemTemplate>
              <A href='javascript:onclick=LoadFreight(<%# DataBinder.Eval(Container,"DataItem.id")%>)'>
               详细信息</A>
             </ItemTemplate>
            </asp:TemplateColumn>
           </Columns>
          </asp:datagrid>
         </TD>
        </TR>
    然后写一个JavaScript方法
    <script language="javascript">
    function LoadFreight(id)//id为传进的参数
    {
     var url='url.aspx?tid='+id+'';
     window.open(url,'','scrollbars=yes,top=0,left=0,resizable=no,status=no,toolbar=no,menubar=no,location=no,width=430,height=600');
    }
    </script>
      

  3.   

    在IE 6 for Windows XP SP2中,window.open等方法是可以被拦截的。关于IE 6 for Windows XP SP2的窗口阻止程序,可以拦截:
    What Does the Pop-up Blocker Block?
    The Pop-up Blocker blocks script-initiated pop-up windows that are created by the following methods, without the user clicking a link. If users enable the most restrictive setting in the Pop-up Blocker Settings, the Pop-up Blocker blocks windows that are opened by these methods from a user-initiated action, such as clicking a page element or tabbing to a link and then pressing ENTER.window.open
    window.showHelp
    window.showModalDialog
    window.showModelessDialog
    window.external.NavigateAndFindIn addition to blocking script-initiated pop-up windows, the Pop-up Blocker also blockssetHomePage() from launching automatically. This function can be launched only from a user-initiated action, such as clicking a page element or tabbing to a link and then pressing ENTER.
    Scripts from automatically targeting the search pane.
    Windows that are opened automatically from DHTML elements that overlap content on the same page.
    Scripts from calling window.open on an onunload event in an attempt to get the user to stay on a site, or to serve the user one more ad.
    Scripts from targeting and then navigating to a named frame that doesn't exist.
    When the Pop-up Blocker prevents pop-up windows from appearing, the action triggers the Information Bar. Users can decide if they want to see the blocked window by clicking on the Information Bar.
      

  4.   

    使用<a href="xxx.aspx" target="_blank">来替换window.open吧。在xxx.aspx中:
    self.moveTo(0,0);
    self.resizeTo(screen.availWidth,screen.availHeight);