Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 15, 2012 12:13 PM by thuanto
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?
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?
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.
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.
Jun 21, 2012 11:00 AM|LINK
I was also getting same error. I removed "feature" section from the Index.cshtml of "Home". and it is working as expected.
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.