Skip to content

Commit

Permalink
added ASP.NET WebForms sample (#71)
Browse files Browse the repository at this point in the history
* sample with webforms
* let the webforms sample do something usefull
* set isPackable=false for samples
* disabled building of samples
  • Loading branch information
fw2568 authored May 9, 2021
1 parent 7d212d5 commit 0f57fe4
Show file tree
Hide file tree
Showing 176 changed files with 69,964 additions and 59 deletions.
27 changes: 15 additions & 12 deletions YaNco.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "net472", "net472", "{0B7CE0
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SAPWebAPI", "samples\net472\SAPWebAPI\SAPWebAPI.csproj", "{427D3A36-64DA-42F7-B406-95B7078F50EB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "webforms", "webforms", "{338C6406-0200-4091-9F3A-7BFFC39B81E0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SAPWebForms", "samples\webforms\SAPWebForms\SAPWebForms.csproj", "{463C83C6-5BC6-4140-9F7F-204B6F886FC3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -126,47 +130,44 @@ Global
{BAFF7A74-DB10-45D9-A3CB-827239599D88}.Debug|x86.ActiveCfg = Debug|Any CPU
{BAFF7A74-DB10-45D9-A3CB-827239599D88}.Debug|x86.Build.0 = Debug|Any CPU
{BAFF7A74-DB10-45D9-A3CB-827239599D88}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BAFF7A74-DB10-45D9-A3CB-827239599D88}.Release|Any CPU.Build.0 = Release|Any CPU
{BAFF7A74-DB10-45D9-A3CB-827239599D88}.Release|x64.ActiveCfg = Release|Any CPU
{BAFF7A74-DB10-45D9-A3CB-827239599D88}.Release|x64.Build.0 = Release|Any CPU
{BAFF7A74-DB10-45D9-A3CB-827239599D88}.Release|x86.ActiveCfg = Release|Any CPU
{BAFF7A74-DB10-45D9-A3CB-827239599D88}.Release|x86.Build.0 = Release|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Debug|x64.ActiveCfg = Debug|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Debug|x64.Build.0 = Debug|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Debug|x86.ActiveCfg = Debug|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Debug|x86.Build.0 = Debug|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Release|Any CPU.Build.0 = Release|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Release|x64.ActiveCfg = Release|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Release|x64.Build.0 = Release|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Release|x86.ActiveCfg = Release|Any CPU
{89240742-3F31-4BA5-89A6-81C0CA6AE451}.Release|x86.Build.0 = Release|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Debug|x64.ActiveCfg = Debug|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Debug|x64.Build.0 = Debug|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Debug|x86.ActiveCfg = Debug|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Debug|x86.Build.0 = Debug|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Release|Any CPU.Build.0 = Release|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Release|x64.ActiveCfg = Release|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Release|x64.Build.0 = Release|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Release|x86.ActiveCfg = Release|Any CPU
{90FDEB6C-05A9-45FF-A566-0230CA724235}.Release|x86.Build.0 = Release|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|x64.ActiveCfg = Debug|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|x64.Build.0 = Debug|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|x86.ActiveCfg = Debug|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Debug|x86.Build.0 = Debug|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|Any CPU.Build.0 = Release|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|x64.ActiveCfg = Release|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|x64.Build.0 = Release|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|x86.ActiveCfg = Release|Any CPU
{427D3A36-64DA-42F7-B406-95B7078F50EB}.Release|x86.Build.0 = Release|Any CPU
{463C83C6-5BC6-4140-9F7F-204B6F886FC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{463C83C6-5BC6-4140-9F7F-204B6F886FC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{463C83C6-5BC6-4140-9F7F-204B6F886FC3}.Debug|x64.ActiveCfg = Debug|Any CPU
{463C83C6-5BC6-4140-9F7F-204B6F886FC3}.Debug|x64.Build.0 = Debug|Any CPU
{463C83C6-5BC6-4140-9F7F-204B6F886FC3}.Debug|x86.ActiveCfg = Debug|Any CPU
{463C83C6-5BC6-4140-9F7F-204B6F886FC3}.Debug|x86.Build.0 = Debug|Any CPU
{463C83C6-5BC6-4140-9F7F-204B6F886FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{463C83C6-5BC6-4140-9F7F-204B6F886FC3}.Release|x64.ActiveCfg = Release|Any CPU
{463C83C6-5BC6-4140-9F7F-204B6F886FC3}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -179,6 +180,8 @@ Global
{90FDEB6C-05A9-45FF-A566-0230CA724235} = {BEE8F8E1-8859-4A61-B668-5467423911D7}
{0B7CE0F5-179E-41BA-BBAC-5E9001550E43} = {D81DD87D-D96B-4A06-B360-B71BED6E5199}
{427D3A36-64DA-42F7-B406-95B7078F50EB} = {0B7CE0F5-179E-41BA-BBAC-5E9001550E43}
{338C6406-0200-4091-9F3A-7BFFC39B81E0} = {D81DD87D-D96B-4A06-B360-B71BED6E5199}
{463C83C6-5BC6-4140-9F7F-204B6F886FC3} = {338C6406-0200-4091-9F3A-7BFFC39B81E0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3AB2171-471F-4842-A039-4CE0AC4FBB45}
Expand Down
49 changes: 2 additions & 47 deletions samples/WebApi.Shared/WebApi.Shared.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>

<IsPackable>false</IsPackable>

Expand All @@ -22,7 +22,7 @@

</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.0" />

Expand All @@ -36,49 +36,4 @@
<ProjectReference Include="..\..\src\YaNco\YaNco.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\nwrfcsdk\x64\lib\icudt50.dll" Link="icudt50.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\nwrfcsdk\x64\lib\icuin50.dll" Link="icuin50.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\nwrfcsdk\x64\lib\icuuc50.dll" Link="icuuc50.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\nwrfcsdk\x64\lib\libicudecnumber.dll" Link="libicudecnumber.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\nwrfcsdk\x64\lib\libsapucum.dll" Link="libsapucum.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\nwrfcsdk\x64\lib\sapnwrfc.dll" Link="sapnwrfc.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\nwrfcsdk\x64\lib\sapnwrfc.pdb" Link="sapnwrfc.pdb">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<None Include="..\..\nwrfcsdk\linux-x64\lib\libicudata.so.50" Link="libicudata.so.50">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\nwrfcsdk\linux-x64\lib\libicudecnumber.so" Link="libicudecnumber.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\nwrfcsdk\linux-x64\lib\libicui18n.so.50" Link="libicui18n.so.50">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\nwrfcsdk\linux-x64\lib\libicuuc.so.50" Link="libicuuc.so.50">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\nwrfcsdk\linux-x64\lib\libsapnwrfc.so" Link="libsapnwrfc.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\..\nwrfcsdk\linux-x64\lib\libsapucum.so" Link="libsapucum.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions samples/net472/SAPWebAPI/SAPWebAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<UserSecretsId>577d8ea0-f844-4a6c-a833-a9b0aa7ceb79</UserSecretsId>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions samples/netcore2.1/SAPWebAPI/SAPWebAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<UserSecretsId>7d94b62b-aac1-4e69-b6e0-d9bcb672dcaf</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..\..</DockerfileContext>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions samples/netcore3.1/SAPWebAPI/SAPWebAPI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>

<DockerfileContext>..\..\..</DockerfileContext>
<IsPackable>false</IsPackable>

</PropertyGroup>

<ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions samples/webforms/SAPWebForms/About.aspx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<%@ Page Title="About" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="About.aspx.cs" Inherits="SAPWebForms.About" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<h2><%: Title %>.</h2>
<h3>Your application description page.</h3>
<p>Use this area to provide additional information.</p>
</asp:Content>
17 changes: 17 additions & 0 deletions samples/webforms/SAPWebForms/About.aspx.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SAPWebForms
{
public partial class About : Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}
}
16 changes: 16 additions & 0 deletions samples/webforms/SAPWebForms/About.aspx.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions samples/webforms/SAPWebForms/App_Start/BundleConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Optimization;
using System.Web.UI;

namespace SAPWebForms
{
public class BundleConfig
{
// For more information on Bundling, visit https://go.microsoft.com/fwlink/?LinkID=303951
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/WebFormsJs").Include(
"~/Scripts/WebForms/WebForms.js",
"~/Scripts/WebForms/WebUIValidation.js",
"~/Scripts/WebForms/MenuStandards.js",
"~/Scripts/WebForms/Focus.js",
"~/Scripts/WebForms/GridView.js",
"~/Scripts/WebForms/DetailsView.js",
"~/Scripts/WebForms/TreeView.js",
"~/Scripts/WebForms/WebParts.js"));

// Order is very important for these files to work, they have explicit dependencies
bundles.Add(new ScriptBundle("~/bundles/MsAjaxJs").Include(
"~/Scripts/WebForms/MsAjax/MicrosoftAjax.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js",
"~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"));

// Use the Development version of Modernizr to develop with and learn from. Then, when you’re
// ready for production, use the build tool at https://modernizr.com to pick only the tests you need
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
"~/Scripts/modernizr-*"));
}
}
}
18 changes: 18 additions & 0 deletions samples/webforms/SAPWebForms/App_Start/RouteConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Routing;
using Microsoft.AspNet.FriendlyUrls;

namespace SAPWebForms
{
public static class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
var settings = new FriendlyUrlSettings();
settings.AutoRedirectMode = RedirectMode.Permanent;
routes.EnableFriendlyUrls(settings);
}
}
}
7 changes: 7 additions & 0 deletions samples/webforms/SAPWebForms/Bundle.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<bundles version="1.0">
<styleBundle path="~/Content/css">
<include path="~/Content/bootstrap.css" />
<include path="~/Content/Site.css" />
</styleBundle>
</bundles>
17 changes: 17 additions & 0 deletions samples/webforms/SAPWebForms/Contact.aspx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<%@ Page Title="Contact" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Contact.aspx.cs" Inherits="SAPWebForms.Contact" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<h2><%: Title %>.</h2>
<h3>Your contact page.</h3>
<address>
One Microsoft Way<br />
Redmond, WA 98052-6399<br />
<abbr title="Phone">P:</abbr>
425.555.0100
</address>

<address>
<strong>Support:</strong> <a href="mailto:[email protected]">[email protected]</a><br />
<strong>Marketing:</strong> <a href="mailto:[email protected]">[email protected]</a>
</address>
</asp:Content>
17 changes: 17 additions & 0 deletions samples/webforms/SAPWebForms/Contact.aspx.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SAPWebForms
{
public partial class Contact : Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}
}
16 changes: 16 additions & 0 deletions samples/webforms/SAPWebForms/Contact.aspx.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions samples/webforms/SAPWebForms/Content/Site.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* Move down content because we have a fixed navbar that is 50px tall */
body {
padding-top: 50px;
padding-bottom: 20px;
}

/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}

/* Set widths on the form inputs since otherwise they're 100% wide */
input,
select,
textarea {
max-width: 280px;
}


/* Responsive: Portrait tablets and up */
@media screen and (min-width: 768px) {
.jumbotron {
margin-top: 20px;
}

.body-content {
padding: 0;
}
}
Loading

0 comments on commit 0f57fe4

Please sign in to comment.