私のスクリプト
$("#btnDelete").click(function () {
$.post(url, { fileName: _fileNameAttachementPhoto }, function (data) {
$("#ResumePart4").html(data);
});
});
私のコントローラー
[HttpPost]
public ActionResult DeleteConfirmed(string fileName)
{
var path = Path.Combine(Server.MapPath("~/App_Data/uploads"), fileName);
FileInfo file = new FileInfo(path);
if (file.Exists) {
file.Delete();
}
return RedirectToAction("DeleteConfirmed");
}
私はこれをやろうとしましたが、何も起こりませんでした。