zoukankan      html  css  js  c++  java
  • C#后台调用js方法无效果,未解决。

    this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "", "<script>Ceshi();</script>", true);

    这句代码与下面这段代码放一起,不管是插在哪里,这句代码都无效,无法调用js

    注释掉

    Page.Response.Clear();

    Page.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(Path.GetFileName(filepath), System.Text.Encoding.UTF8));
    Page.Response.AppendHeader("Content-Length", fiOutFile.Length.ToString());

    就可以调用js,但是下面这段导出excel的代码就异常了。

    求解。。。。

        

    FileInfo fiOutFile = new FileInfo(filepath);
    Page.Response.Clear();
    Page.Response.ClearHeaders();
    Page.Response.Buffer = false;
    Page.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(Path.GetFileName(filepath), System.Text.Encoding.UTF8));
    Page.Response.AppendHeader("Content-Length", fiOutFile.Length.ToString());
    Page.Response.WriteFile(fiOutFile.FullName);
    fiOutFile.Delete();
    Page.Response.Flush();
    Page.Response.End();

  • 相关阅读:
    如何方便的下载youtube视频?
    88. Merge Sorted Array
    83. Remove Duplicates from Sorted List
    70. Climbing Stairs
    用opencv+python全屏进行显示图片
    58. Length of Last Word
    numpy的resize和reshape区别
    Opencv的绘图
    Python的slice问题
    jqgrid一次性加载
  • 原文地址:https://www.cnblogs.com/suxiaBlogs/p/7102072.html
Copyright © 2011-2022 走看看