Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8497239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:04:40+00:00 2026-06-11T00:04:40+00:00

I created a website using ASPNET.MVC4 RC. For each view I created 2 files

  • 0

I created a website using ASPNET.MVC4 RC. For each view I created 2 files like index.cshtml and index.Mobile.cshtml which represent desktop and mobile views. Out of the box everything is working fine – mobile devices get mobile view and non-mobile devices get full desktop view.
However I have a problem trying to force desktop view onto the mobile devices (i.e. when user clicks on “Full site” link) – view does not change and mobile view still gets rendered.
I use following code to override browser (called from global filter):

  filterContext.RequestContext.HttpContext.SetOverriddenBrowser(BrowserOverride.Desktop);

I can see that following cookie gets set:.ASPXBrowserOverride=[Mozilla%2f4.0+(compatible%3b+MSIE+6.1%3b+Windows+XP)] as result of this call, but obviously it gets ignored for some reason.
Forcing mobile view on desktop browsers works fine, i.e. other way around.
Any help would be greatly appreciated.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:04:41+00:00Added an answer on June 11, 2026 at 12:04 am

    I have found where my problem was. In case somebody falls into the same trap, here is what it was:

    When I was creating my project I took contents for my device configuration class, which adds mobile DefaultDisplayMode to DisplayModeProvider, from support answer I found on Microsoft support forums.

    That code was looking for mobile device specific strings in Request.UserAgent. However SetOverriddenBrowser() method changes only overridden user agent, Request.UserAgent remains untouched.

    So solution is to replace Request.UserAgent with Context.GetOverriddenUserAgent() when analyzing client’s request.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this website iloveforwards.com created using drupal. I would like to have a
I have created a website using asp.net and I have created some resource files
I've created a MVC website using Visual Studio 2010 and would like to deploy
I created a new ASP.NET website using Visual Web Developer 2008 Express edition and
I created a website using Canvas on the client side to display animations. Sometimes
I have created a website using vbulletin i have installed CMS and BLOG modules
I have created a website using modx evolution v1.0.2. The website that I have
I'm using the Zend Framework for my website, and just created a special module
I have created a website using ASP.NET MVC and use ELMAH for error handling,
I have created an Asp.net website using VS 2008 and SQL Express 2008 on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.