Try Now
More in this section

Forums / General Discussions / Mobile Site Redirection switch

Mobile Site Redirection switch

3 posts, 0 answered
  1. Braden
    Braden avatar
    4 posts
    23 Sep 2010
    10 May 2011
    Link to this post
    I am currently using the UserAgentKeyword flags in my web.config to detect if a user is going to access the site with a mobile device.  What I need to do is provide a switch that allows the user to see the normal site.  Is there a way around this because if I try to go to the main page it will redirect me to the mobile version if I type it in.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    19 Oct 2016
    10 May 2011
    Link to this post
    Hello Braden,

    You can create a custom class that inherits from InternalPage. Inside your custom class you can override GetTheme and GetMasterPageName where you can return the theme and master page at runtime, so you can load appropriate files depending on the request.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    18 Jul 2012
    10 May 2011
    Link to this post
    I dealt with this exact issue when developing my Sitefinity Toolkit (now open source on codeplex) for Sitefinity 3.x

    I used a query string (mobile=0 or mobile=1), and on each page render a link to the same path but with the querystring opposite of the current mode. On page load I detect the mode (caching it in the session) and set the theme/master page appropriately as Ivan suggested.

    I suggest you take a look at the kit, perhaps it's enough to fill your needs but if nothing else can at least give you an idea of where to get started.

    hope this was helpful!
Register for webinar
3 posts, 0 answered