I have some jquery shown below required to run my mvc action and return the view.
$("#workspaces").change(function () {
var workspaceId = $('#workspaces').val();
var url = '@Url.Action("SingleWorkspace", "Workspaces", new { id = workspaceId })';
$.ajax({
url: url,
success: function () { alert("true"); }
});
});
Basically the first issue i have is that it does not recognise the workspaceId within the url action if though the var is declared above it.
Secondly this is within a partial view as it is a dropdown menu. So by calling the url.action above how would it load the page?
any help would be appreciated
cheers
You could use the following: