I have a table with some information(view is called Index) , an add button and an edit button (which is supposed to send me to some other page and populate it with the object i want to edit)(view is call AddTest) When i select one row and i click edit i am redirected right here which is ok
public ActionResult EditTest(int? id)
{
Test t= (id.HasValue) ? new Test_Service().GetByID(Convert.ToInt32(id)) : new Test();
TempData["currentTest"] = t;
return RedirectToAction("AddTest",(Test)TempData["currentTest"]);
}
I get the corresponding object and i am redirected right here which is ok
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult AddTest()
{
if (TempData["currentTest"] == null)
TempData["currentTest"] = new Test();
return View((Test)TempData["currentTest"]);
}
The problem is that i don't get to see the AddTest View although i send to it the correct data and if put a breakpoint in the view i can see that data gets there.
What i'm i doing wrong?