在做项时一直用360浏览器(ie8)做调试。最近在做到:if(window.confirm('下载文件扣除10分'))
{
    var id = 1;
    window.location="ClearScores.ashx?indexData=" + id;      
}在360浏览器做测试时,当弹出"下载文件扣除10积分"时,点击确定后,发现其一直在ClearScores.ashx代码中循环更新数据ClearScores.ashx就是一般的更新方法update 。。用过ie8测试,谷歌浏览器,火狐测试,均没有问题,
唯一是360会存在提交重复循环更新N次数据。有遇见这类怪事的吗?因为项目要兼容360浏览器。一直无法解决,求救!

解决方案 »

  1.   

    解决,原来网上流传的下面这段代码 对ie和火狐有效,其他浏览器不兼容。会重复查询file.Name。
    public void downloadfile(string s_fileName)   
        {   
           HttpContext.Current.Response.ContentType = "application/ms-download";   
           string s_path = HttpContext.Current.Server.MapPath("~/") + s_fileName;   
           System.IO.FileInfo file = new System.IO.FileInfo(s_path);   
           HttpContext.Current.Response.Clear();   
           HttpContext.Current.Response.AddHeader("Content-Type", "application/octet-stream");   
           HttpContext.Current.Response.Charset = "utf-8";   
           HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(file.Name, System.Text.Encoding.UTF8));   
           HttpContext.Current.Response.AddHeader("Content-Length", file.Length.ToString());   
           HttpContext.Current.Response.WriteFile(file.FullName);   
           HttpContext.Current.Response.Flush();   
           HttpContext.Current.Response.Clear();   
           HttpContext.Current.Response.End();   
        }   换了下面代码,终于解决。http://www.cnblogs.com/xtgyiq/archive/2009/07/06/1517415.html晕乎乎弄了一整天。怎么就想不到是代码问题呢?哎!