BkCoding

A responsible theme for WordPress

asp.net mvc部分视图的action中获取父级视图相关信息

public ActionResult Child()
{
       var parentView = RouteData.DataTokens["ParentActionViewContext"] as ViewContext;
            
       return View();
}

parentView中包含了父级视图的路由等数据

点赞