当前位置: 移动技术网 > IT编程>开发语言>.net > 巧用section在cshtml写入layout中写入head信息 ASP.NET MVC

巧用section在cshtml写入layout中写入head信息 ASP.NET MVC

2019年04月19日  | 移动技术网IT编程  | 我要评论

华冠大学在哪,郑州猪头三,神雕之林清传

layout文件中:

<head>
<meta charset="utf-8" />
<title>@viewbag.title</title>
<link href="@url.content("~/content/site.css")" rel="stylesheet" type="text/css" />
@rendersection("head", false)
</head>
 cshtml模板文件中:

@section head
{
<script type="text/javascript"">
   //your java script here
</script>
}

 


摘自 阿旭博客

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网