System.Web.HttpException: The file "~/xxx//Index.cshtml" cannot be requested directly because it cal
2011-03-12 13:07
627 查看
刚开始用Razor的时候经常把RenderSection当作RenderPartial的替代品,其实它是ContentHolder的替代品。
Section的意图是在上级页面(原来的master)中建立一个空间,在子级页面中向其中根据需要填充内容。因此不能在被直接调用的子页面(如index)中直接写RenderSetion,而只能写@section。
因此直接访问带有RenderSection的页面,相当于直接调用master。
点击下载免费的敏捷开发教材:《火星人敏捷开发手册》
Section的意图是在上级页面(原来的master)中建立一个空间,在子级页面中向其中根据需要填充内容。因此不能在被直接调用的子页面(如index)中直接写RenderSetion,而只能写@section。
因此直接访问带有RenderSection的页面,相当于直接调用master。
点击下载免费的敏捷开发教材:《火星人敏捷开发手册》
相关文章推荐
- System.Web.HttpException: The file "~/xxx//Index.cshtml" cannot be requested directly because it cal
- System.Web.HttpException: The file "~/xxx//Index.cshtml" cannot be requested directly because it cal
- System.Web.HttpException: The file "~/xxx//Index.cshtml" cannot be requested directly because it cal
- System.Web.HttpException: The file "~/xxx//Index.cshtml" cannot be requested directly because it cal
- System.Web.HttpException: The file "~/xxx//Index.cshtml" cannot be requested directly because it cal
- Could not load file or assembly "xxx" or one of its dependencies. The system cannot find the file sp
- maven构建 出错:cannot be resolved to absolute file path because it does not reside in the file system
- VS2010 + Sql Server Express 2008 R2 如何安装(兼谈错误:The database 'XXX' cannot be opened because it is version 661. This server support
- cannot be resolved to absolute file path because it does not reside in the file system
- cannot be resolved to absolute file path because it does not reside in the file system : jar:file:/D
- iOS 报错:没有查看权限the file "xxx.app" couldn't be opened because you don't have permission to view it.
- cannot be resolved to absolute file path because it does not reside in the file system
- "The object cannot be deleted because it was not found in the ObjectStateManager."
- iOS the file "xxx.app" couldn't be opened because you don't have permission to view it.
- the file "xxx.app" couldn't be opened because you don't have permission to view it.
- fix errors 1088: “Failed to execute request because the App-Domain could not be created. Error: 0x80070005 Access is denied” and 1334: “Exception: System.IO.FileLoadException”
- Database 'xxx' cannot be upgraded because it is read-only or has read-only file Make the database or files writeable, and rerun recovery.
- java.io.FileNotFoundException: [WEB-INF/spring-servlet.xml] cannot be opened because it does not exist
- java.io.FileNotFoundException: class path resource [WEB-INF/classes/cn/golaxy/yqpt/pojo/] cannot be resolved to URL because it
- Cannot implicitly convert type 'System.Web.HttpPostedFile' to 'System.Web.HttpPostedFileBase'