I'm trying to pass this Person Object from my view to controller without Form, how do I do that?
Here's my attempt:
VIEW
<%=Html.ActionLink(
"Jump",
"Jump",
new { name="MyName",
person=ViewData["Person"]}, // lets assume ViewData["Person"] is not null
null) %>
CONTROLLER
public ActionResult Jump(string name, Person person)
{
return View();
}
While Debugging the app in the Jump method, the name parameter shows "MyName", but Person parameter in null. Why does it behave this way?
Is it because it only works for primitive types such as int, string, etc. and doesn't work for complex types such as that Person object?
What's the way around it?