Eliminata master mobile e switcher...

This commit is contained in:
Samuele E. Locatelli
2015-05-15 11:31:10 +02:00
parent b2a13123f8
commit a404a4763b
9 changed files with 46 additions and 170 deletions
+4 -17
View File
@@ -219,6 +219,7 @@
<None Include="NLog.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Properties\PublishProfiles\IIS02.pubxml" />
<None Include="Scripts\jquery-1.9.1.intellisense.js" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
@@ -252,14 +253,14 @@
<Content Include="Scripts\WebForms\WebForms.js" />
<Content Include="Scripts\WebForms\WebParts.js" />
<Content Include="Scripts\WebForms\WebUIValidation.js" />
<Content Include="ViewSwitcher.ascx" />
<Content Include="Web.config" />
<Content Include="Bundle.config" />
<Content Include="Bundle.config">
<SubType>Designer</SubType>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Scripts\jquery-1.9.1.min.map" />
<None Include="Scripts\_references.js" />
<Content Include="Site.Mobile.Master" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
@@ -339,20 +340,6 @@
<Compile Include="Site.Master.designer.cs">
<DependentUpon>Site.Master</DependentUpon>
</Compile>
<Compile Include="Site.Mobile.Master.cs">
<DependentUpon>Site.Mobile.Master</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Site.Mobile.Master.designer.cs">
<DependentUpon>Site.Mobile.Master</DependentUpon>
</Compile>
<Compile Include="ViewSwitcher.ascx.cs">
<DependentUpon>ViewSwitcher.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ViewSwitcher.ascx.designer.cs">
<DependentUpon>ViewSwitcher.ascx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<MSDeployServiceURL>https://IIS02:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/CMS_SC</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>steamwarewin\administrator</UserName>
<_SavePWD>True</_SavePWD>
<PublishDatabaseSettings>
<Objects xmlns="">
<ObjectGroup Name="DefaultConnection" Order="1" Enabled="False">
<Destination Path="" />
<Object Type="DbDacFx">
<PreSource Path="Data Source=(LocalDb)\v11.0;AttachDbFilename=|DataDirectory|\aspnet-CMS_SC-20150515094114.mdf;Initial Catalog=aspnet-CMS_SC-20150515094114;Integrated Security=True" includeData="False" />
<Source Path="$(IntermediateOutputPath)AutoScripts\DefaultConnection_IncrementalSchemaOnly.dacpac" dacpacAction="Deploy" />
</Object>
<UpdateFrom Type="Web.Config">
<Source MatchValue="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-CMS_SC-20150515094114;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-CMS_SC-20150515094114.mdf" MatchAttributes="$(UpdateFromConnectionStringAttributes)" />
</UpdateFrom>
</ObjectGroup>
</Objects>
</PublishDatabaseSettings>
</PropertyGroup>
<ItemGroup>
<MSDeployParameterValue Include="$(DeployParameterPrefix)DefaultConnection-Web.config Connection String">
<UpdateDestWebConfig>False</UpdateDestWebConfig>
</MSDeployParameterValue>
</ItemGroup>
</Project>
-23
View File
@@ -1,23 +0,0 @@
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.Mobile.master.cs" Inherits="CMS_SC.Site_Mobile" %>
<%@ Register Src="~/ViewSwitcher.ascx" TagPrefix="friendlyUrls" TagName="ViewSwitcher" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta name="viewport" content="width=device-width" />
<title></title>
<asp:ContentPlaceHolder runat="server" ID="HeadContent" />
</head>
<body>
<form id="form1" runat="server">
<div>
<h1>Mobile Master Page</h1>
<asp:ContentPlaceHolder runat="server" ID="FeaturedContent" />
<section class="content-wrapper main-content clear-fix">
<asp:ContentPlaceHolder runat="server" ID="MainContent" />
</section>
<friendlyUrls:ViewSwitcher runat="server" />
</div>
</form>
</body>
</html>
-17
View File
@@ -1,17 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace CMS_SC
{
public partial class Site_Mobile : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
-51
View File
@@ -1,51 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CMS_SC {
public partial class Site_Mobile {
/// <summary>
/// HeadContent control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ContentPlaceHolder HeadContent;
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// FeaturedContent control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ContentPlaceHolder FeaturedContent;
/// <summary>
/// MainContent control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ContentPlaceHolder MainContent;
}
}
-4
View File
@@ -1,4 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ViewSwitcher.ascx.cs" Inherits="CMS_SC.ViewSwitcher" %>
<div id="viewSwitcher">
<%: CurrentView %> view | <a href="<%: SwitchUrl %>">Switch to <%: AlternateView %></a>
</div>
-43
View File
@@ -1,43 +0,0 @@
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 CMS_SC
{
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 swith view route is out of sync
this.Visible = false;
return;
}
var url = GetRouteUrl(switchViewRouteName, new { view = AlternateView });
url += "?ReturnUrl=" + HttpUtility.UrlEncode(Request.RawUrl);
SwitchUrl = url;
}
}
}
-15
View File
@@ -1,15 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace CMS_SC {
public partial class ViewSwitcher {
}
}
Binary file not shown.