Hi,
I have a controller that sets TempData before returning a view,
public ActionResult Edit(int id, int? order)
{
Route route = new Route();
// Do Work
TempData["Route"] = route;
return View(new FormViewModel(route, obj1, obj2));
}
This view contians a partial view with a link which goes to another action method called delete, the code for the delete link is:
<%= Html.ActionLink("Delete", "Delete", new { order = item.Order })%>
The code for the Delete action method is:
public ActionResult Delete(int order)
{
Route route = (Route)TempData["Route"];
// Do Work
}
The problem that I'm having is when I try to get TempData["Route"]; from the Delete action method is returning null.
I'm wondering if the issue is that this is a Get and not a Post? If so how can I do a Post to the Delete ActionMethod from within my form?