亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

angular.js - ANGULARJS HTTP.GET transfers value, but the parameter value cannot be received in the background
我想大聲告訴你
我想大聲告訴你 2017-05-15 16:49:26
0
1
821

HTML:

<button type="submit" ng-click="get3(model.Name)">查詢</button>


js:
$scope.get3 = function (name) {
        $http.get("/Movies/Search/" + name).success(function (data) {
            $scope.model = data;
        })
    }(這邊name可以收到前臺傳過來的值)

MVC CONTROLLER:
public ActionResult Search(string Name)
        {


            var movie9 = db.Movies.Where(p => p.Name == Name);
            Movie movied = (Movie)movie9;
            return Json(new
            {
                Name = movied.Name,
                Genra = movied.Genra

            }, JsonRequestBehavior.AllowGet);
        }

(The parameter Name here is always NULL, that is to say, the value cannot be passed from the JS side)

我想大聲告訴你
我想大聲告訴你

reply all(1)
滿天的星座

Enter ../Movies/Search/xxxx directly into the browser and see if there is a value on the server side. If there is no value on the server side, it means it is not a problem with Angular $http, but a problem with your ASP.NET MVC routing settings. .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template