0
我有一個查看組件_Layout.cshtml
。我的申請有一條路線/home/{id}
。我如何從View Component控制器獲取URL路由中的id
值?如何從.NET Core的View Component控制器中獲取路由值?
public class LayoutViewComponent : ViewComponent
{
public async Task<IViewComponentResult> InvokeAsync()
{
//how do I get the value of {id} here?
return View();
}
}