什么是mvc布局文件扩展名? [英] what is mvc layout file extension ?

查看:102
本文介绍了什么是mvc布局文件扩展名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Layout.cshtml----> .cshtml文件表示asp.net中的文件名是什么?

(例如:html)

ex:





添加布局

文件_Layout.cshtml表示应用程序中每个页面的布局。它位于Views文件夹内的Shared文件夹中。

打开文件并用以下内容交换内容:

"Layout.cshtml" ----> .cshtml file means what is the file name in asp.net?
(ex: html)
ex:


Adding a Layout
The file _Layout.cshtml represent the layout of each page in the application. It is located in the Shared folder inside the Views folder.
Open the file and swap the content with this:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")"></script>
</head>
<body>
<ul id="menu">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
<li>@Html.ActionLink("Movies", "Index", "Movies")</li>
<li>@Html.ActionLink("About", "About", "Home")</li>
</ul> 
<section id="main">
@RenderBody()
<p>Copyright W3schools 2012. All Rights Reserved.</p>
</section>
</body>
</html>



________________________________________


________________________________________

推荐答案

.cshtml意味着它是一个剃刀格式的mvc3 / 4视图或局部视图。



As其余的,似乎没有问题。
.cshtml means it is a razor-formatted mvc3/4 view or partial view.

As for the rest, there doesn''t seem to be a question.


这篇关于什么是mvc布局文件扩展名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆