虽然路径正确,但在Asp.NET中找不到资源?

问题描述 投票:0回答:1

我正在使用ajax调用向动作方法传递值。我的动作方法名称是 标签目标 而这个方法有三个参数。我也给出了准确的路径,但得到的错误是 找不到资源。

//Ajax Call to get targets Data
    function TargetsData() {
        var realTags = $('#Raw_Tag_List').val();
        var calculatedTags = $('#Calculated_Tag_List').val();
        var manulTags = $('#Manual_Tag_List').val();
        $.ajax({
            url: 'TagTargets',
            type: 'Post',
            contentType: 'application/json',
            dataType: 'json',
            data: { 'RealTags': realTags, 'CalculatedTags': calculatedTags, 'ManulTags':manulTags},
                success: function (data) {
                    if (data.success) {
                        alert('Ok')
                    }
                    else {
                        alert('Not ok');
                    }
                }

        });
        debugger;
        }

//Action Method
 [HttpPost]
        public JsonResult TagTargets(List<string> RealTags, List<string> CalculatedTags, List<string> ManulTags) 
        {

            return Json(true);
        }
javascript jquery ajax asp.net-mvc asp.net-ajax
1个回答
0
投票

改变你的url为有效的url。

url: "@Url.Action("TagTargets","ControllerName");",
© www.soinside.com 2019 - 2024. All rights reserved.