I know this is an old thread - but here is how I did it.
In web\App_Code\SkinBase.cs, in the function GetTemplateName, right below
Code:
m_ismobile = HttpContext.Current.Request.Browser.IsMobileDevice || CheckUserAgentForMobile;
, I added the following:
Code:
m_ismobile = IsMobileOverride(m_ismobile);
.
The function IsMobileOverride is the following:
Code:
public static bool IsMobileOverride(bool OriginalValue)
{
//Check for Query String
if (CommonLogic.QueryStringBool("ShowMobile"))
{
HttpContext.Current.Response.Cookies["ASPDNSF.IsMobile"].Value = "1";
HttpContext.Current.Response.Cookies["ASPDNSF.IsMobile"].Expires = DateTime.Now.AddDays(30);
return true;
}
//Check for Query String
if (CommonLogic.QueryStringBool("LeaveMobile"))
{
HttpContext.Current.Response.Cookies["ASPDNSF.IsMobile"].Value = "0";
HttpContext.Current.Response.Cookies["ASPDNSF.IsMobile"].Expires = DateTime.Now.AddDays(30);
return false;
}
//Check for cookie
string cookieIsMobile = CommonLogic.CookieCanBeDangerousContent("ASPDNSF.IsMobile", false);
if (cookieIsMobile.Length > 0) // Override is set
{
return (cookieIsMobile == "1");
}
return OriginalValue;
}
I then use ?showmobile=1 and ?leavemobile=1 to switch to and from the mobile skin.