开发者

Getting null value in controller when passing the list through routvalues (html.action)

开发者 https://www.devze.com 2023-04-03 05:41 出处:网络
When i passlistthrough routevalues in \"Html.Action\" I am always getting null value in controller. But when i pass interger,string or bool i am getting the correct value.

When i pass list through routevalues in "Html.Action" I am always getting null value in controller. But when i pass interger,string or bool i am getting the correct value.

How to pass list through routevalues?

My View is

@Html.Action("ViewTeam", "ProjectTeamManagement", new { Team = @Model.ProjecTeam})

The controller is

    public ActionResult ViewTeam(List<Pro开发者_开发技巧jectTeam> Team)
    {
        return PartialView("ViewTeam",Team);
    }


I think the problem is that the html.action will have the "Get" Method... It is not possible to pass the list to the Get method through routevalues. We should use Ajax Post method to pass the list.

0

精彩评论

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