I saw some posts related to this, but it can't seem to make it work. When redirecting, I get "the resource could not be found by error."
I am trying to redirect to the details page. The element has an identifier that I store as NestId, which I want to eventually pass to the view. Right now I just want to redirect to the details page, there is no model or something like that. I just want NestId to do it there so that I can use it to create more AJAX calls.
Here is my jQuery:
$('#results').on('click', '.item', function () { var NestId = $(this).data('id'); var url = '@Url.Action("Details, Artists")'; window.location.href = url; })
Here is the function on the controller:
public ActionResult Details(string NestId) { ViewBag.NestId = NestId; return View(); }
I'm not sure if I will do it right, but help will be appreciated, I am a bit stumped. Thanks!
javascript jquery asp.net-mvc url-redirection
mrshickadance
source share