using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.IO;
namespace IWOMTracker_C.Controllers
{
public class BatchImportController : Controller
{
#region 批量导入
public ActionResult Index()
{
return View();
}
#endregion
#region 下载模板
public ActionResult DownLoadTemplate()
{
string FullFileName = System.Web.HttpContext.Current.Server.MapPath("../Upload/ExcelFile/ImportTemplate.xlsx");
return File(FullFileName, "application/octet-stream", System.IO.Path.GetFileName(FullFileName));
}
#endregion
}
}
view
<input type="button" value="下载上传模板" onclick="javascript:downloadTemplate();" /></span>
<script type="text/javascript">
function downloadTemplate() {
window.location = "/BatchImport/DownLoadTemplate";
}
</script>
<script type="text/javascript">
function downloadTemplate() {
window.location = "/BatchImport/DownLoadTemplate";
}
</script>