4
mvc 4で部分ビューにパラメーターを渡す方法
私はこのようなリンクを持っています: <a href='Member/MemberHome/Profile/Id'><span>Profile</span></a> これをクリックすると、この部分ページが呼び出されます。 @{ switch ((string)ViewBag.Details) { case "Profile": { @Html.Partial("_Profile"); break; } } } 部分ページ_Profileに含まれるもの: Html.Action("Action", "Controller", model.Paramter) 例: @Html.Action("MemberProfile", "Member", new { id=1 }) // id is always changing 私の疑問は、この「Id」をmodel.parameterパーツにどのように渡すことができるかということです。 私のコントローラーは: public ActionResult MemberHome(string id) { ViewBag.Details = id; return View(); } public ActionResult MemberProfile(int id = …