![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MVC4
一直学习
这个作者很懒,什么都没留下…
展开
-
ASP.NET MVC:Razor 引入命名空间
页面中引用 c# @using MvcApplication83.Models @using MvcApplication83.Common 行尾不需要加分号,加上也无妨(不过得全加上)。 VB.Net @Imports MvcApplication83.Models @Imports MvcApplication83.Common 配置文件中引用 必须在 Vie转载 2014-07-09 15:50:00 · 1961 阅读 · 0 评论 -
MVC4 Razor @hepler 让cshtml方法变成类 进行多视图调用
@hepler语法可以定义可重复使用的帮助器方法 在我的cshtml页面上, @helper myHelper(int? a) { if(a.HasValue) { p>A值为:@a.ToString()p> } else { p>A无值p> } } div style="w转载 2014-07-09 16:24:23 · 2761 阅读 · 0 评论 -
MVC4 Razor @RenderSection -母版设置
Mvc4的Razor视图引擎还提供了@RenderSection 我的理解:@RenderSection在母版页中占个位,然后让使用此母版页的子页自己去呈现他们的Section。 在母版页_Layout.cshtml中定义@RenderSection("Section名") body> div id="header">div> div id="sideBar">转载 2014-07-09 15:48:32 · 5931 阅读 · 0 评论 -
asp.net mvc3 Razor引擎中@使用规则小记
1 2 3 @if(true) 4 { 5 6 } 7 错误页面:转载 2014-07-29 11:48:22 · 5787 阅读 · 0 评论 -
ASP.NET MVC4中用 BundleCollection使用问题手记
ASP.NET MVC4中对JS和CSS的引用又做了一次变化,在MVC3中我们这样引用资源文件: link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> 将在运行的时候自动将虚拟(相对)路径转换为应用程序绝对路径。这是比较传统的引用方式,尽管他做了一次转换操作,对服务器的请求数量压转载 2014-07-09 15:33:28 · 4012 阅读 · 1 评论 -
未能加载文件或程序集“WebGrease,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序
方法一:在web.config的configuration接点中添加,最好是添加在configuration节点的最后 runtime> assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> dependentAssembly> assemblyIdentity name="WebGrease" publicKeyToken=转载 2014-07-09 15:32:47 · 18054 阅读 · 0 评论