I want to redirect to an action in other Controller but it doesn\'t work here\'s my code in ProductManagerController:
[HttpPost]
public ActionResult RedirectToIm
This should work!
[HttpPost]
public ActionResult RedirectToImages(int id)
{
return RedirectToAction("Index", "ProductImageManeger", new { id = id });
}
[HttpGet]
public ViewResult Index(int id)
{
return View(_db.ProductImages.Where(rs => rs.ProductId == id).ToList());
}
Notice that you don't have to pass the name of view if you are returning the same view as implemented by the action.
Your view should inherit the model as this:
@model
You can then access your model in view as:
@Model.