Hello, I am having trouble sending a JSON object to my action and could really use some assistance. The object is located in a different controller than where I'm trying to send it.
var pData = { id: null, StateCity: statecityName, Zip: zipcode, MaxDistance: maxdist, PhyName: phyName, ClickCnt: 0 };
window.location.href = '@Url.Action("Index", "Different", new { @pData=pData})';
However, when I try to access pData
, it says it cannot be found.
The action in my DifferentController
looks like this:
public ActionResult Index(PData pData )
{
//some work
return view();
}