在 .net core 2.0 中使用 razor page,用 Html.Partial 引用其他 razor page并傳值,以前MVC里可以,在razor page 中行不通,有什么替代方法嗎?試過傳遞 ViewData, 不可行@page@{ Html.RenderPartial("_Shared", ViewData["active"] = "about");} _Shared.cshtml 文件@page@model String<p>@Model</p> NullReferenceException: Object reference not set to an instance of an object.
- 1 回答
- 0 關注
- 778 瀏覽
添加回答
舉報
0/150
提交
取消