0
我與ASP.NET的MVC3工作,以下是我的控制器的方法,如何在無數據時顯示錯誤消息?
public ActionResult TravelReadyAdminDownloadInvoke(int intId, int intMonth)
{
TravelReadyAdminModel objTravelReadyAdminModel = new TravelReadyAdminModel();
try
{
if (intId == 3)
{
objTravelReadyAdminModel = objTravelReadyAdminModel.GetTravelReadyAdminRawExport(intId, intMonth);
if (objTravelReadyAdminModel.lstRawDataEntities == null)
{
}
else
{
objTravelReadyAdminModel.ExportTravelReadyAdmin("TRAdminRawData", objTravelReadyAdminModel.lstRawDataEntities);
}
}
}
catch (Exception ex)
{
ILogManager LogManager = new LogManager();
var frame = new StackFrame(0);
LogManager.CallLogging(frame, ex.Message, ex.StackTrace);
return RedirectToAction("Error", "Common");
}
return View();
}
我需要什麼樣的代碼透露了一些內幕,如果狀態顯示錯誤消息框?