删除文件后,我需要向用户显示成功消息。不知道该怎么做。请帮忙。
public ActionResult deleteGeneratedInvoice(string invoiceNumber)
{
try
{
string fileName = invoiceNumber.Trim() + ".pdf";
string filePath = HostingEnvironment.MapPath("~/Content/reports/");
string fullFilePath = filePath + fileName;
System.IO.File.Delete(fullFilePath);
//What shall i return here to display message?
return
}
catch (Exception e)
{
InvoiceSearchTool.Models.udtExceptionTable exception = new udtExceptionTable();
exception.MethodName = "deleteGeneratedInvoice";
exception.Exception = e.ToString();
exception.Date = DateTime.Now;
DYNAMICS_EXTEntities db = new DYNAMICS_EXTEntities();
db.AddToudtExceptionTables(exception);
db.SaveChanges();
//return View ("Error");
}
}