Skip to content

Commit 7ced5d2

Browse files
committed
Initial code checkin
Initial code checkin
1 parent 2882048 commit 7ced5d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+24753
-0
lines changed

Diff for: EADemoApp.sln

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.28803.202
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EADemoApp", "EADemoApp\EADemoApp.csproj", "{DA872601-4238-477B-A1E5-16BADADFEE0C}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeleniumTest", "SeleniumTest\SeleniumTest.csproj", "{819EDF40-BBFE-4E5B-BD5D-6F6A9639BDA8}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{DA872601-4238-477B-A1E5-16BADADFEE0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{DA872601-4238-477B-A1E5-16BADADFEE0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{DA872601-4238-477B-A1E5-16BADADFEE0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{DA872601-4238-477B-A1E5-16BADADFEE0C}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{819EDF40-BBFE-4E5B-BD5D-6F6A9639BDA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{819EDF40-BBFE-4E5B-BD5D-6F6A9639BDA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{819EDF40-BBFE-4E5B-BD5D-6F6A9639BDA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{819EDF40-BBFE-4E5B-BD5D-6F6A9639BDA8}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {7ADC1200-AEA1-4A9C-9761-7753C4200A8E}
30+
EndGlobalSection
31+
EndGlobal

Diff for: EADemoApp/EADemoApp.csproj

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.AspNetCore.App" />
9+
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
10+
</ItemGroup>
11+
12+
</Project>

Diff for: EADemoApp/Pages/About.cshtml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@page
2+
@model AboutModel
3+
@{
4+
ViewData["Title"] = "About";
5+
}
6+
<h2>@ViewData["Title"]</h2>
7+
<h3>@Model.Message</h3>
8+
9+
<p>Use this area to provide additional information.</p>

Diff for: EADemoApp/Pages/About.cshtml.cs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc.RazorPages;
6+
7+
namespace EADemoApp.Pages
8+
{
9+
public class AboutModel : PageModel
10+
{
11+
public string Message { get; set; }
12+
13+
public void OnGet()
14+
{
15+
Message = "Your application description page.";
16+
}
17+
}
18+
}

Diff for: EADemoApp/Pages/Contact.cshtml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@page
2+
@model ContactModel
3+
@{
4+
ViewData["Title"] = "Contact";
5+
}
6+
<h2>@ViewData["Title"]</h2>
7+
<h3>@Model.Message</h3>
8+
9+
<address>
10+
One Microsoft Way<br />
11+
Redmond, WA 98052-6399<br />
12+
<abbr title="Phone">P:</abbr>
13+
425.555.0100
14+
</address>
15+
16+
<address>
17+
<strong>Support:</strong> <a href="mailto:[email protected]">Support@example.com</a><br />
18+
<strong>Marketing:</strong> <a href="mailto:[email protected]">Marketing@example.com</a>
19+
</address>

Diff for: EADemoApp/Pages/Contact.cshtml.cs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc.RazorPages;
6+
7+
namespace EADemoApp.Pages
8+
{
9+
public class ContactModel : PageModel
10+
{
11+
public string Message { get; set; }
12+
13+
public void OnGet()
14+
{
15+
Message = "Your contact page.";
16+
}
17+
}
18+
}

Diff for: EADemoApp/Pages/Error.cshtml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@page
2+
@model ErrorModel
3+
@{
4+
ViewData["Title"] = "Error";
5+
}
6+
7+
<h1 class="text-danger">Error.</h1>
8+
<h2 class="text-danger">An error occurred while processing your request.</h2>
9+
10+
@if (Model.ShowRequestId)
11+
{
12+
<p>
13+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
14+
</p>
15+
}
16+
17+
<h3>Development Mode</h3>
18+
<p>
19+
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
20+
</p>
21+
<p>
22+
<strong>Development environment should not be enabled in deployed applications</strong>, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>, and restarting the application.
23+
</p>

Diff for: EADemoApp/Pages/Error.cshtml.cs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore.Mvc;
7+
using Microsoft.AspNetCore.Mvc.RazorPages;
8+
9+
namespace EADemoApp.Pages
10+
{
11+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
12+
public class ErrorModel : PageModel
13+
{
14+
public string RequestId { get; set; }
15+
16+
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
17+
18+
public void OnGet()
19+
{
20+
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
21+
}
22+
}
23+
}

Diff for: EADemoApp/Pages/Index.cshtml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
@page
2+
@model IndexModel
3+
@{
4+
ViewData["Title"] = "Home page";
5+
}
6+
7+
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
8+
<ol class="carousel-indicators">
9+
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
10+
<li data-target="#myCarousel" data-slide-to="1"></li>
11+
<li data-target="#myCarousel" data-slide-to="2"></li>
12+
</ol>
13+
<div class="carousel-inner" role="listbox">
14+
<div class="item active">
15+
<img src="~/images/banner1.svg" alt="ASP.NET" class="img-responsive" />
16+
<div class="carousel-caption" role="option">
17+
<p>
18+
Learn how to build ASP.NET apps that can run anywhere.
19+
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525028&clcid=0x409">
20+
Learn More
21+
</a>
22+
</p>
23+
</div>
24+
</div>
25+
<div class="item">
26+
<img src="~/images/banner2.svg" alt="Visual Studio" class="img-responsive" />
27+
<div class="carousel-caption" role="option">
28+
<p>
29+
There are powerful new features in Visual Studio for building modern web apps.
30+
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525030&clcid=0x409">
31+
Learn More
32+
</a>
33+
</p>
34+
</div>
35+
</div>
36+
<div class="item">
37+
<img src="~/images/banner3.svg" alt="Microsoft Azure" class="img-responsive" />
38+
<div class="carousel-caption" role="option">
39+
<p>
40+
Learn how Microsoft's Azure cloud platform allows you to build, deploy, and scale web apps.
41+
<a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkID=525027&clcid=0x409">
42+
Learn More
43+
</a>
44+
</p>
45+
</div>
46+
</div>
47+
</div>
48+
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
49+
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
50+
<span class="sr-only">Previous</span>
51+
</a>
52+
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
53+
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
54+
<span class="sr-only">Next</span>
55+
</a>
56+
</div>
57+
58+
<div class="row">
59+
<div class="col-md-3">
60+
<h2>Application uses</h2>
61+
<ul>
62+
<li>Sample pages using ASP.NET Core Razor Pages</li>
63+
<li>Theming using <a href="https://go.microsoft.com/fwlink/?LinkID=398939">Bootstrap</a></li>
64+
</ul>
65+
</div>
66+
<div class="col-md-3">
67+
<h2>How to</h2>
68+
<ul>
69+
<li><a href="https://go.microsoft.com/fwlink/?linkid=852130">Working with Razor Pages.</a></li>
70+
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699315">Manage User Secrets using Secret Manager.</a></li>
71+
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699316">Use logging to log a message.</a></li>
72+
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699317">Add packages using NuGet.</a></li>
73+
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699319">Target development, staging or production environment.</a></li>
74+
</ul>
75+
</div>
76+
<div class="col-md-3">
77+
<h2>Overview</h2>
78+
<ul>
79+
<li><a href="https://go.microsoft.com/fwlink/?LinkId=518008">Conceptual overview of what is ASP.NET Core</a></li>
80+
<li><a href="https://go.microsoft.com/fwlink/?LinkId=699320">Fundamentals of ASP.NET Core such as Startup and middleware.</a></li>
81+
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398602">Working with Data</a></li>
82+
<li><a href="https://go.microsoft.com/fwlink/?LinkId=398603">Security</a></li>
83+
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699321">Client side development</a></li>
84+
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699322">Develop on different platforms</a></li>
85+
<li><a href="https://go.microsoft.com/fwlink/?LinkID=699323">Read more on the documentation site</a></li>
86+
</ul>
87+
</div>
88+
<div class="col-md-3">
89+
<h2>Run &amp; Deploy</h2>
90+
<ul>
91+
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517851">Run your app</a></li>
92+
<li><a href="https://go.microsoft.com/fwlink/?LinkID=517853">Run tools such as EF migrations and more</a></li>
93+
<li><a href="https://go.microsoft.com/fwlink/?LinkID=398609">Publish to Microsoft Azure App Service</a></li>
94+
</ul>
95+
</div>
96+
</div>

Diff for: EADemoApp/Pages/Index.cshtml.cs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
using Microsoft.AspNetCore.Mvc.RazorPages;
7+
8+
namespace EADemoApp.Pages
9+
{
10+
public class IndexModel : PageModel
11+
{
12+
public void OnGet()
13+
{
14+
15+
}
16+
}
17+
}

Diff for: EADemoApp/Pages/Privacy.cshtml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@page
2+
@model PrivacyModel
3+
@{
4+
ViewData["Title"] = "Privacy Policy";
5+
}
6+
<h2>@ViewData["Title"]</h2>
7+
8+
<p>Use this page to detail your site's privacy policy.</p>

Diff for: EADemoApp/Pages/Privacy.cshtml.cs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
using Microsoft.AspNetCore.Mvc.RazorPages;
7+
8+
namespace EADemoApp.Pages
9+
{
10+
public class PrivacyModel : PageModel
11+
{
12+
public void OnGet()
13+
{
14+
}
15+
}
16+
}

Diff for: EADemoApp/Pages/Shared/_CookieConsentPartial.cshtml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
@using Microsoft.AspNetCore.Http.Features
2+
3+
@{
4+
var consentFeature = Context.Features.Get<ITrackingConsentFeature>();
5+
var showBanner = !consentFeature?.CanTrack ?? false;
6+
var cookieString = consentFeature?.CreateConsentCookie();
7+
}
8+
9+
@if (showBanner)
10+
{
11+
<nav id="cookieConsent" class="navbar navbar-default navbar-fixed-top" role="alert">
12+
<div class="container">
13+
<div class="navbar-header">
14+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#cookieConsent .navbar-collapse">
15+
<span class="sr-only">Toggle cookie consent banner</span>
16+
<span class="icon-bar"></span>
17+
<span class="icon-bar"></span>
18+
<span class="icon-bar"></span>
19+
</button>
20+
<span class="navbar-brand"><span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span></span>
21+
</div>
22+
<div class="collapse navbar-collapse">
23+
<p class="navbar-text">
24+
Use this space to summarize your privacy and cookie use policy.
25+
</p>
26+
<div class="navbar-right">
27+
<a asp-page="/Privacy" class="btn btn-info navbar-btn">Learn More</a>
28+
<button type="button" class="btn btn-default navbar-btn" data-cookie-string="@cookieString">Accept</button>
29+
</div>
30+
</div>
31+
</div>
32+
</nav>
33+
<script>
34+
(function () {
35+
document.querySelector("#cookieConsent button[data-cookie-string]").addEventListener("click", function (el) {
36+
document.cookie = el.target.dataset.cookieString;
37+
document.querySelector("#cookieConsent").classList.add("hidden");
38+
}, false);
39+
})();
40+
</script>
41+
}

0 commit comments

Comments
 (0)