0

In regular ASP.NET MVC we used IDisplayMode to implement a display mode provider and then configure it in Global.asax.cs file. This was particularly useful because we'd have a view called Index.cshtml and another one Index.Mobile.cshtml and the provider would decide which view to resolve.

How can I achieve the same within ASP.NET Core? I've come across IViewLocationExpander interface which "is the right way to do things" (from this issue) with no further infomation. I also can't find any other resources about this.

Martin Shishkov
  • 2,709
  • 5
  • 27
  • 44
  • look here https://stackoverflow.com/a/46552775/9020340 – ArunPratap Dec 20 '18 at 10:59
  • I’ve closed this question with a link to a related question that covers the question for AMP but is generally asking the same thing (how to switch views based on some logic, like what display mode previously allowed). The answer there shows how to use the view location expander. – poke Dec 20 '18 at 11:00

0 Answers0