\ No newline at end of file
diff --git a/GMW/ViewSwitcher.ascx.cs b/GMW/ViewSwitcher.ascx.cs
new file mode 100644
index 00000000..c5c60eab
--- /dev/null
+++ b/GMW/ViewSwitcher.ascx.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Routing;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using Microsoft.AspNet.FriendlyUrls.Resolvers;
+
+namespace GMW
+{
+ public partial class ViewSwitcher : System.Web.UI.UserControl
+ {
+ protected string CurrentView { get; private set; }
+
+ protected string AlternateView { get; private set; }
+
+ protected string SwitchUrl { get; private set; }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ // Determine current view
+ var isMobile = WebFormsFriendlyUrlResolver.IsMobileView(new HttpContextWrapper(Context));
+ CurrentView = isMobile ? "Mobile" : "Desktop";
+
+ // Determine alternate view
+ AlternateView = isMobile ? "Desktop" : "Mobile";
+
+ // Create switch URL from the route, e.g. ~/__FriendlyUrls_SwitchView/Mobile?ReturnUrl=/Page
+ var switchViewRouteName = "AspNet.FriendlyUrls.SwitchView";
+ var switchViewRoute = RouteTable.Routes[switchViewRouteName];
+ if (switchViewRoute == null)
+ {
+ // Friendly URLs is not enabled or the name of the switch view route is out of sync
+ this.Visible = false;
+ return;
+ }
+ var url = GetRouteUrl(switchViewRouteName, new { view = AlternateView, __FriendlyUrls_SwitchViews = true });
+ url += "?ReturnUrl=" + HttpUtility.UrlEncode(Request.RawUrl);
+ SwitchUrl = url;
+ }
+ }
+}
\ No newline at end of file
diff --git a/GMW/ViewSwitcher.ascx.designer.cs b/GMW/ViewSwitcher.ascx.designer.cs
new file mode 100644
index 00000000..56c8ec63
--- /dev/null
+++ b/GMW/ViewSwitcher.ascx.designer.cs
@@ -0,0 +1,15 @@
+//------------------------------------------------------------------------------
+//