I have been reading this link from Steven Sanderson about mobile web development http://www.asp.net/learn/whitepapers/add-mobile-pages-to-your-aspnet-web-forms-mvc-application, and I am trying to execute his razor code in aspx.
Razor code from url:
@{
Layout = Request.Browser.IsMobileDevice ? "~/Views/Shared/_LayoutMobile.cshtml"
: "~/Views/Shared/_Layout.cshtml";
}
My aspx adaptation:
<%@ Page Title="" Language="C#" MasterPageFile=Request.Browser.IsMobileDevice ? "~/Views/Shared/mobile.Master" : "~/Views/Shared/site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
but this gives me this error:
ASP.NET runtime error: Only Content controls are allowed directly in a content page that contains Content controls.
Is there a way to do this in aspx?