zoukankan      html  css  js  c++  java
  • 实现下载完成

    RouteConfig里面加一个

    routes.MapRoute(
    name: "Download",
    url: ""
    );

    然后用ajax 访问Execl 运行的

    public string OutAllCompany()
    {
    Dictionary<string, string> execl = new Dictionary<string, string>()
    {
    {"CoId","公司ID" },
    {"CoName","公司名称" },
    {"CoCompanytype","公司性质" },
    {"CoRemark","备注" },
    {"CoCreateddate","创建时间" },
    {"CoCreateUsId","创建人" },
    {"CoUptUsid","修改人" },
    {"CoUptDate","修改时间" },
    {"CoIsdeleted","是否删除" },
    {"CoDelUsId","删除人" },
    {"CoDelDate","删除时间" },
    {"CoAddress","公司地址" }
    };

    string CompanyInfo = Client.GetApi("http://localhost:54098/api/", ResuFull.get, "Company/GetCompany");
    List<Company> list = JsonConvert.DeserializeObject<List<Company>>(CompanyInfo);
    string url = ExcelHelper.EntityListToExcel2003(execl,list, "公司信息表");

    return Url.RouteUrl("Download")+url;//************************************
    }

    function DaoChu() {
    $.ajax({
    url: "/Company/OutAllCompany",
    success: function (data) {
    location.href = data;
    }
    })
    }

  • 相关阅读:
    es6 简介
    npm 快速开发技巧
    css清除浮动方法
    mui 总结
    7种 JS 创建对象的经典方式
    JavaScript 的 this 原理
    使用定时器
    dom 操作及方法
    JavaScript的6种继承方式及其优缺点
    贪吃蛇游戏代码
  • 原文地址:https://www.cnblogs.com/Kirins/p/10517749.html
Copyright © 2011-2022 走看看