【发布时间】:2017-02-22 10:59:45
【问题描述】:
我从事 mvc 5 项目。
在我的_Layout.cshtml 上,我有一个名为id="topBar" 的html 元素,该元素显示在每个页面中。
但我有一个名为 About.cshtml 的页面我不希望此页面仅显示元素 id="topBar" _Layout.cshtml 中的所有其他 html 元素我希望它们在 About.cshtml 中正常显示。
知道如何实现上述外观吗?
【问题讨论】:
-
不能用
jQuery来实现吗? -
@if (ViewContext.RouteData.Values["action"].ToString() != "About") { ... }
标签: asp.net asp.net-mvc