public ActionResult Download(){var document = …var cd = new System.Net.Mime.ContentDisposition{// for example foo.bakFileName = document.FileName,// always prompt the user for downloading, set to true if you want// the browser to try to show the file inlineInline = false,};Response.AppendHeader("Content-Disposition", cd.ToString());return File(document.Data, document.ContentType);}
and Remember to use news {target="_blank"} in ActionLink parameter
版权声明:本文为博主原创文章,未经博主允许不得转载。
,功夫不负有心人。