title: DisplayMode doesn't change to mobile view when controller action contains view path
body: <p>I'm trying to implement device specific views in a ASP.NET MVC application, as described e.g. here:
   <a href="https://www.simple-talk.com/dotnet/asp-net/multiple-views-and-displaymode-providers-in-asp-net-mvc-4/" rel="nofollow noreferrer">https://www.simple-talk.com/dotnet/asp-net/multiple-views-and-displaymode-providers-in-asp-net-mvc-4/</a>
   or here:
   <a href="https://docs.microsoft.com/en-us/aspnet/mvc/overview/older-versions/aspnet-mvc-4-mobile-features" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/mvc/overview/older-versions/aspnet-mvc-4-mobile-features</a> </p>
  
  <p>Although the articles above are geared towards ASP.NET MVC4, their content is relevant for later versions of the framework (my app is using ASP.NET MVC 5.2). </p>
  
  <p>I've stumbled on an issue. I have the following controller: </p>
  
  <pre><code>public class TestController: Controller
  {
      public ActionResult Test()
      {
          return View(new TestModel());
      }
      public ActionResult Test2()
      {
          return View("~/Views/Test/Test.cshtml", new TestModel());
      }
  }
  </code></pre>
  
  <p>The Test model is really basic:</p>
  
  <pre><code>public class TestModel
  {
      public string TheDate
      {
          get
          {
              return DateTime.Now.ToString();
          }
      }
  }
  </code></pre>
  
  <p>And I have two views in the "~/Views/Test" folder:</p>
  
  <p>Test.cshtml</p>
  
  <pre><code>@model MyNamespace.Models.TestModel
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;This is the desktop view&lt;/h1&gt;
  &lt;p&gt;model data: @Model.TheDate&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Test.Mobile.cshtml</p>
  
  <pre><code>@model MyNamespace.Models.TestModel
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;This is the mobile view&lt;/h1&gt;
  &lt;p&gt;model data: @Model.TheDate&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I've implemented the solution described in the links above. </p>
  
  <p>When asking for /test/test, I get the proper view (Test.cshtml when requesting it through my desktop browser and Test.Mobile.cshtml when requesting it from a mobile emulator). However, when asking for /test/test2, i get the desktop view all the time.</p>
  
  <p>I've searched for a solution to my problem, but everyone seems to be reproducing the same scenario over and over (i.e. the "/test/test" scenario) and nobody seems to have tried to do the "/test/test2" scenario. Is it even possible to override that functionality? I'm not afraid to get my hands dirty with overriding default razor/MVC functionality, but I don't really know where to start with this. </p>
  
  <p>Any help is appreciated.</p>