为什么这个简单的jQuery不工作?

问题描述:

我有这样的jQuery的GET请求:

I have this jQuery get request:

$.get($(this).attr("href"), { "searchExpression": "schroders" }, function (result) {

    // do stuff

}, "html");

,它发送GET请求,这个动作方法:

Which sends the get request to this Action Method:

public PartialViewResult Tabs(string searchExpression)
{
    return PartialView(new SearchViewModel
    {
        PagedFunds = _fundService.GetFunds(searchExpression)
    });
}

$。获得请求发送到标签方法的请求,但 searchEx pression 始终是一个空字符串。我以前这样做,它的工作..没有任何人有任何想法,为什么要么不被发送的数据或模型绑定不工作?

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?

编辑:我刚刚发现正在使用的jQuery的版本是1.2​​.6。此外,还有的网站上正在使用的另一个JS框架 - 原型,我想 - 所以这是管理的兼容性问题的完整功能,我使用了GET,

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

原来,这是答案的的真正的问题是这里概述:

It turns out this is the the answer to the real issue is outlined here:

http://stackoverflow.com/questions/3362147/how-to-send-jquery-get-so-the-model-binder-can-bind-a-string-to-a-parameter