I'm using the mobile capabilities of MVC4. So I created a _layout.mobile.cshtml and the corresponding views.
The error above happens when I go in with a mobile device. As you can see, it is trying to display the regular _layout.cshtml instead of the _layout.mobile.cshtml. So I'm assuming it is also trying to display the view (say Index.mobile.cshtm) which doesn't
have the section in question. Basically it is mixing the regular layout with the mobile views. In addition the non mobile layout _layout.csthml does not require the section in question
@RenderSection("featured", required: false)
This doesn't happen all the time. If I recycle the pool it works again for a while and then all of the sudden it goes back to having the error and it will continue until I recycle the pool again.
Has anyone seen this problem before that can shed some light?
I know there are a few ways you can differentiate which version of MVC a browser sees depending on whether it's a mobile device or PC. Can you specify how your application is detecting the correct versions?
I've been experiencing the same issue as well. Occurred on MVC 4 Beta, then updated to MVC 4 RC and it is still happening. I'm not using 51 Degrees, just a simple RegEx match for mobile detection.
thetruth1960
0 Points
2 Posts
The following sections have been defined but have not been rendered for the layout page “~/Views/...
May 24, 2012 07:45 PM|LINK
I'm using the mobile capabilities of MVC4. So I created a _layout.mobile.cshtml and the corresponding views.
The error above happens when I go in with a mobile device. As you can see, it is trying to display the regular _layout.cshtml instead of the _layout.mobile.cshtml. So I'm assuming it is also trying to display the view (say Index.mobile.cshtm) which doesn't have the section in question. Basically it is mixing the regular layout with the mobile views. In addition the non mobile layout _layout.csthml does not require the section in question @RenderSection("featured", required: false)
This doesn't happen all the time. If I recycle the pool it works again for a while and then all of the sudden it goes back to having the error and it will continue until I recycle the pool again.
Has anyone seen this problem before that can shed some light?
Thanks
John
mobile
JohnLocke
Contributor
3206 Points
710 Posts
Re: The following sections have been defined but have not been rendered for the layout page “~/Vi...
May 24, 2012 07:53 PM|LINK
I know there are a few ways you can differentiate which version of MVC a browser sees depending on whether it's a mobile device or PC. Can you specify how your application is detecting the correct versions?
thetruth1960
0 Points
2 Posts
Re: The following sections have been defined but have not been rendered for the layout page “~/Vi...
May 24, 2012 08:34 PM|LINK
I'm using the MVC4 capabilities with 51Degree data added to make sure I have the most current database of browsers.
I'm using .mobile for the layouts and views since that's the default one built in in MVC4.
thuanto
Member
8 Points
4 Posts
Re: The following sections have been defined but have not been rendered for the layout page “~/Vi...
Jun 20, 2012 05:26 AM|LINK
Hi, how have you gone with this issue?
I've been experiencing the same issue as well. Occurred on MVC 4 Beta, then updated to MVC 4 RC and it is still happening. I'm not using 51 Degrees, just a simple RegEx match for mobile detection.
yogeshvardhm...
Member
5 Points
9 Posts
Re: The following sections have been defined but have not been rendered for the layout page “~/Vi...
Jun 21, 2012 11:00 AM|LINK
Hi All,
I was also getting same error. I removed "feature" section from the Index.cshtml of "Home". and it is working as expected.
Software Engineer,
InfoSystem Software Pvt. Ltd.
thuanto
Member
8 Points
4 Posts
Re: The following sections have been defined but have not been rendered for the layout page “~/Vi...
Jul 15, 2012 12:13 PM|LINK
I believe the issue here is the same as in the following post where the OP has identified the cause.
http://forums.asp.net/p/1824033/5066571.aspx/1?p=True&t=634779365311215476