ASP.NET MVC4 - Issue with Rendersection

73 Views Asked by At

Below are the layout sections used separately for desktop & mobile rendering. I am facing an issue in production, at some time the body content for mobile sets to desktop. I am suspecting whether it is a problem with rendersection/Same body name used for both layouts/Any other? Any ideas please share. Note: Also i am using WURFL for device detection

Desktop Layout

<div class="wrapper column-one-hundred">
@{ Html.RenderPartial("_Header"); }
<div class="container">
@{ 
  Html.RenderPartial("_Error", null);
  Html.RenderPartial("_Session");
 }
 @RenderBody()
 @RenderSection("body")
 </div>
 </div>
 @{ Html.RenderPartial("_Footer"); }

Mobile Layout

<div id="page" class="c">
@{ Html.RenderPartial("_Header.Mobile"); }
@{
Html.RenderPartial("_Error.Mobile", null);
Html.RenderPartial("_Session.Mobile");
}
@RenderBody()
@RenderSection("body")
@{ Html.RenderPartial("_Footer.Mobile"); }
</div>
1

There are 1 best solutions below

3
Luca P. On

Which WURFL Product, version and wurfl.xml version are you using?

Also, what you posted are the views. Based on your description the issue seems likely to be in the "dispatcher" part, i.e. the part that determines whether an HTTP request originates from a desktop browser or a mobile device. It will probably also help if you post the user-agent strings of the devices that you find problematic.