this is my controller
public ActionResult Index()
{
return View();
}
[HttpPost]
public ActionResult Validate(HttpPostedFileBase excelfile)
{
if(excelfile==null || excelfile.ContentLength==0)
{
TempData["Message"] = "Please select a excel file";
return View("Index");
}
From here i am passing a TempData["Message"]
to view.how to check whether TempData["Message"]
is not null in view ?
And in my view i am using <script> @TempData["Message"]</script>
to give a alert