Mobile Device Override

Brenden Kehren asked on March 27, 2014 22:31

I'm attempting to use the Switch Mobile Device Detection webpart and its not working as I'd expect. I've placed it on my /Mobile.aspx master page and it displays the desktop/mobile text as expected but its not sending me to the root ( / ) of the site like I thought it might. The Redirection webpart notices when I come to any part other than the /Mobile.aspx page and redirects as I'd expect but I just can't figure out the Switch Detection webpart.

Recent Answers


Zdeněk Cetkovský answered on May 21, 2014 11:07

Hi Brenden,

This one and Mobile device redirection are two independent web parts. In case you still haven't figured out the functionality of Switch Mobile Device Detection, a quick look into its code should reveal it (~\CMSWebParts\DeviceProfile\SwitchDeviceDetection.ascx.cs):

The result is a cookie set:

CookieHelper.SetValue(CookieName.ShowDesktopVersion, value.ToString(), DateTime.Now.AddYears(1));

and a redirect performed:

URLHelper.Redirect(RequestContext.CurrentURL);

The cookie is then used only in DeviceProfileInfoProvider method GetCurrentDeviceProfiles to decide whether to load the profile from cookie or not.

Please feel free to contact us if you have any additional questions.

Regards, Zdenek

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.