asp.net点击按钮下载图片而不是打开图片

//下载图片
Response.ContentType = "application/x-msdownload";
string filename = "attachment; filename=" + "123.jpg";
Response.AddHeader("Content-Disposition", filename);
string filepath = "/images/123.jpg";
Response.TransmitFile(Server.MapPath(filepath));
原文地址:https://www.cnblogs.com/zhuawang/p/2102740.html