开发者

Getting Jquery script to call action method

开发者 https://www.devze.com 2023-03-23 15:42 出处:网络
Good Morning Stack OverFlow enthusiasts.I have been having an issue that I am attempting to narrow down, and I could use the help of the good people at stack overflow...For some reason, the action con

Good Morning Stack OverFlow enthusiasts. I have been having an issue that I am attempting to narrow down, and I could use the help of the good people at stack overflow... For some reason, the action controller that I attempt to call from a view never executes... I have breakpoints set and everything and it just never seems to get called...

    $(function () {
$("#DemoGraphSubmit").click(function (e) {
    e.preventDefault();
    var data = [];
    $.getJSON("/PatientACO.aspx/SearchByDemographic", null, function (data) {
        data = $.map(data, function (item, a) {
            return "<option value=" + item.Value + ">" + item.Text + "</option>";
        });
        $("#PatientListToAdd").html(data.join(""));
    });
});

});

I checked to make sure that the url i开发者_如何学Pythons correct... PatientACOController is my controller and SearchByDemographic is my action method... DemoGraphSubmit is the button in my view that submits... I am not sure what I am doing wrong here... Any help would be appreciated.


If you're using the default routing in MVC the URL should be /PatientACO/SearchByDemographic.

The .aspx part shouldn't exist

0

精彩评论

暂无评论...
验证码 换一张
取 消