如何修复此错误:MVC web中的system.web.httpexception [英] How can I fix this error: system.web.httpexception in MVC web

查看:257
本文介绍了如何修复此错误:MVC web中的system.web.httpexception的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建设MVC 4网上商店,在完成我想要的东西之后,我下载了在线商店主页的bootstrap,我把css文件放在内容文件夹和js文件在scripts文件夹中,然后将这个bootstrap的代码复制到我的_Layout .cshtml,运行项目后我收到此错误:

System.Web.HttpException:已定义以下部分但尚未为布局页面〜/ Views / Shared / _Layout呈现.cshtml:精选。



这是我想要获得的bootstrap主页:

Shop Homepage - Bootstrap电子商务商店模板 - 启动Bootstrap [ ^ ]



我的尝试:



我尝试添加渲染部分,它以某种方式工作但不是我想要的主页设计,我想要我的同性恋epages就像上面链接中的那个,但我是mvc的初学者,所以我需要一些帮助,请

解决方案

asp.net - 以下部分已定义,但尚未针对布局页面〜/ Views / Shared / _Layout.cshtml进行渲染:精选 - Stack Overflow [ ^ ]



您需要更新布局页面以指定不需要特色部分:

 @RenderSection(featured,required:false )


i am building MVC 4 online shop , after finishing what i want , i downloaded bootstrap for online shop homepage , i put the css files in content folder and js files in scripts folder , then copied the code of this bootstrap to my _Layout.cshtml, after running the project i am getting this error:
System.Web.HttpException: The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_Layout.cshtml": "featured".

And this is the bootstrap homepage i am trying to get:
Shop Homepage - Bootstrap Ecommerce Store Template - Start Bootstrap[^]

What I have tried:

well i tried adding render sections , it somehow worked but not the design of the homepage i want ,i want my homepage like the one that in the link above, but i am beginner in mvc ,so that's why i need some help please

解决方案

asp.net - The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_Layout.cshtml": "featured" - Stack Overflow[^]

You need to update your layout page to specify that the "featured" section is not required:

@RenderSection("featured", required: false)


这篇关于如何修复此错误:MVC web中的system.web.httpexception的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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