エラーメッセージ
"Requested URL: /selva/DDL COMMANDS.doc"
実際、私のファイルパスは
URL:/selva/Docs/DDL COMMANDS.doc
私が使用したコード:
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = gvDetails.DataKeys[gvrow.RowIndex].Value.ToString();
Response.ContentType = "application/doc";
Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
Response.TransmitFile(Server.MapPath("~/+ filePath + "));
Response.End();
aspxで
間違いかもしれませんが、誰かがすぐに助けてくれます。前もって感謝します。