弹出导入 Excel 的模态框: 重置表单:KaTeX parse error: Expected 'EOF', got '#' at position 3: ("#̲formImportExcel…("#btnSaveImport").prop(“disabled”, true); 后面就是清空临时表。 点击背景时不关闭动态模态框,按下 esc 时也不关闭动态模态框: KaTeX parse error: Expected 'EOF', got '#' at position 3: ("#̲modImportExamin…("#modImportExaminee").modal(“show”);} 下载模板: 打开一个新的窗口,并在窗口中装载指定 URL 地址的网页 function downImportTemplate() { window.open(“DownImportTemplate”);} DownImportTemplate 是控制器那边传过来的:
获取模板路径:string filePath = Sever.MapPath(……); 后面就是判断模板是否存在……。 在判断里面获取文件名称:string fileName = Path.GetFileName(filePath); filePath就是考生信息导入模板.xls。 返回文件:return File(new FileStream(filePath, FileMode.Open), “application/octet-stream”, fileName);} 如果模板不存在: else { return Content(“模板文件不存在,请联系系统运维人员。”);}}