前台调用
//编辑下载区
function DownloadThird(id, registerid) {
$.messager.confirm('下载接入方', '请核对好下载内容下载?', function (r) {
if (r) {
var url = AjaxHandlerUrl + 'Thirdsystem/DownloadInfo?id=' + id + "®isterid=" + registerid;
window.location.href = url;
}
});
}
//服务端后台代码
public ActionResult DownloadInfo()
{
//
//自己需要下载的数据处理
string fileName = "";
fileName = model.REGISTERID;
Response.Clear();
Response.Buffer = false;
Response.ContentType = "application/octet-stream";
Response.AppendHeader("content-disposition", "attachment;filename=" + fileName + ".txt;");
Response.Write("注册码;" + model.REGISTERID + System.Environment.NewLine);
Response.Flush();
Response.End();
return View();
}