I have this jQuery get request:
$.get($(this).attr("href"), { "searchExpression": "schroders" }, function (result) {
// do stuff
}, "html");
Which sends the get request to this Action Method:
public PartialViewResult Tabs(string searchExpression)
{
return PartialView(new SearchViewModel
{
PagedFunds = _fundService.GetFunds(searchExpression)
});
}
The $.get
request sends a request to the Tabs
method, but searchExpression
is always an empty string. I've done this before and it's worked.. does anyone have any idea why either the data isn't being sent or the Model Binder isn't working?
edit: I've just discovered the version of jQuery being used is 1.2.6. Also, There's another JS framework being used on the site - Prototype, I think - so this is the complete function that I'm using for the GET, which manages the compatibility issues:
jQuery(document).ready(function ($) {
$('.ActionControl a').click(function () {
$.get($(this).attr("href"), { searchExpression: "schroders" }, function (result) {
// do stuff
}, "html");
return false;
});
});
does this offer any clues? Thanks