【发布时间】:2014-08-21 01:16:43
【问题描述】:
我的页面设置了剃须刀代码,以便在每个页面上使用一致的布局。 我不希望页面 url 与 .cshtml 标记一起显示 我怎样才能做到这一点。我使用 JQuery、JavaScript、HTML、CSS、ASP.net(网页逻辑)
前网址; http://www.site.com/page.htm
我是 ASP 和服务器端的新手。
@{
Layout = "~/Shared/_Layout1.cshtml"; <!--i use a _PageStart.cshtml that contains this line for dry purpose-->
Page.title = ""; @*add pages title here*@
}
<!--If you want to add Page specific stylesheets Link them here with HTML tags-->
@section ExtraHeadContent {
}
@section NavBarLinks {
<!--Enter links here for the top navigation bar <a class="topnav-link" href="~/index.html">| Home</a> -->
}
<!--Enter the Pages HTML content here. This will be displayed in the white content div-->
如果您过去发现任何相关页面或讨论,请分享。
【问题讨论】:
-
使用无扩展路由?
-
在 IIS 中更改处理程序映射
-
我不知道阿什利是什么。对不起,我是服务器端的新手
-
您是否真的运行过任何代码来查看 URL?默认情况下,至少对于任何较新版本的 MVC 和/或 IIS URL 都没有扩展期限。 (因此 asawyer 的无扩展名路线评论).cshtml 是视图文件的扩展名,但这不应该是实际浏览网站时显示的内容
-
我使用的是网页逻辑而不是 mvc,是的,我已经实时运行了它。当前唯一会显示没有 .chshtml 扩展名的页面是默认主页,该主页显示“www.example.com/”,我使用剃须刀代码编写的所有其他页面都显示“www.example.com/” PageName.cshtml
标签: javascript html asp.net razor friendly-url