Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I'm just trying to direct the site from mobile version to normal version. It works fine when I go from normal to mobile version, but it applies the mobile styling if i go from mobile to normal. Below is my _layout.cshtml and _mobileLayout.cshtml code.

When I switch back from mobile to mainsite by clicking on the mainsite link, my url points to `"http://localhost/Mobile/GetEmployees#/"` instead of `"http://localhost/MainSiteHOme/Index/"`

Any help would be greatly appreciated. Thanks

**_MobileLayout.cshtml**

HTML
<div data-role="navbar" data-iconpos="left" data-theme="b">
     <ul>
         <li>
             <a href="#" data-role="button" data-mini="true"
                 data-rel="back" data-icon="back">Go Back</a>
         </li>
         <li>
             <a href="@Url.Action("GetEmployees", "Mobile")"
                 data-role="button" data-icon="home">Go Home</a>
         </li>
         <li>
             <a href="@Url.Action("Index", "MainSiteHome")"
                 data-role="button" data-icon="home">Main Site</a>
         </li>
     </ul>
 </div>


**_Layout.cshtml**, this is for the main site

HTML
<nav class="nav">
    <ul>
        <li>@Html.ActionLink("Home", "Index", "MainSiteHome")</li>
        <li>@Html.ActionLink("Mobile Site", "GetEmployees", "Mobile")</li>
        <li>@Html.ActionLink("Help", "Contact", "Home")</li>
    </ul>
</nav>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900