MVC: pass parameter to view?

后端 未结 5 434
梦谈多话
梦谈多话 2020-12-14 19:52

MVC newbie question:

I\'m picking up a URL of the form go/{mainnav}/{subnav}, which I\'ve successfully routed to the GoController class, me

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-14 20:31

    If i understand this can be a solution:

    public ActionResult Index(string mainnav, string subnav)
    {
       return View(mainnav | subnav);
    }
    

    In the Html View you can use View and after

    <%=Model %>
    

提交回复
热议问题