I'd like to achieve the MVC View Engine behavior in an web forms application. To register a mobile channel in MVC I normally would do something like this
public static List<string> UaSurfpads = new List<string>()
{
"iPad",
"MicrosoftRt",
"PlayBook"
};
protected void Application_Start(object sender, EventArgs e)
{
// register surfpads
foreach (string device in UaSurfpads)
{
DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("mobile")
{
ContextCondition = (context => context != null && context.GetOverriddenUserAgent().IndexOf(device, StringComparison.OrdinalIgnoreCase) >= 0)
});
}
// ...
}
This will enable me to create shadow views like myView.mobile.cshtml
.
Is there any similar way to work using regular web forms in asp.net?