zoukankan      html  css  js  c++  java
  • Export功能 导致 页面显示很多非法字符,还可能页面显示两次

            private void exportBinaryToExcel(byte[] bytes, string filename)
            {
                Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
                Response.AddHeader("Content-Length", bytes.Length.ToString());
                Response.ContentType = "application/octet-stream";
                Response.BinaryWrite(bytes);
                Response.Flush();
                Response.End(); //这里的问题
            }

    发现页面局部展示了两次,思考后感觉是页面展现的方法中没有清空上一次的内容,找到代码Response, Google发现Response.End()是结束当前的页面。解决!

  • 相关阅读:
    hdu-1114
    hdu2546
    POJ-3126
    POJ-1915
    ZOJ-1709
    Codeforces 847H
    Codeforces 847C
    Codeforces 847I
    Codeforces 847E
    算法笔记--矩阵及矩阵快速幂
  • 原文地址:https://www.cnblogs.com/webglcn/p/4991806.html
Copyright © 2011-2022 走看看