I am trying to make an ajax call like so:
$('#Grid').load('@Url.Action("_AgentStatesGrid", "AgentStates", new { projectId = Model.SelectedProject, siteId = Model.SelectedSite })', null, refreshComplete);
Unfortunately, it gets interpreted as this:
$('#Grid').load('/AgentStates/_AgentStatesGrid?projectId=179&siteId=0', null, refreshComplete);
As you can see, the &.a.m.p.; is there instead of the ampersand for the querystring (I put dots in because, duh, the web interprets it as an ampersand.., you get the idea)
I tried Url.Decode and that did nothing. I'm not sure I understand the problem so I have no clue how to fix it.
Try
@Html.Raw(Url.Action("_AgentStatesGrid", "AgentStates", new { projectId = Model.SelectedProject, siteId = Model.SelectedSite }))
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With