on my controller i have a "delete" logic after delete i want to redirect to Index view with proper message.
How do i pass it and how i show the message on the Index view?
// POST: /Category/Delete/5
public ActionResult Delete(int id, FormCollection collection)
// TODO: Add delete logic here
var cat = db.categories.SingleOrDefault(x => x.categoryId == id);
if (cat == null)
ViewData["Message"] = "Category was deleted";
ViewData["Message"] = "Error on delete Category";
and my Index
public ActionResult Index()
// var cat
View Complete Post