├── Blazor.Web ├── Pages │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── Privacy.cshtml │ ├── Shared │ │ ├── _ValidationScriptsPartial.cshtml │ │ └── _Layout.cshtml │ ├── Index.cshtml │ ├── Index.cshtml.cs │ ├── Privacy.cshtml.cs │ ├── Error.cshtml │ ├── WASM.cshtml │ ├── Error.cshtml.cs │ └── Server.cshtml ├── wwwroot │ ├── favicon.ico │ ├── css │ │ ├── open-iconic │ │ │ ├── font │ │ │ │ ├── fonts │ │ │ │ │ ├── open-iconic.eot │ │ │ │ │ ├── open-iconic.otf │ │ │ │ │ ├── open-iconic.ttf │ │ │ │ │ └── open-iconic.woff │ │ │ │ └── css │ │ │ │ │ └── open-iconic-bootstrap.min.css │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── FONT-LICENSE │ │ ├── app.css │ │ └── site.css │ ├── js │ │ └── site.js │ ├── sample-data │ │ └── weather.json │ └── lib │ │ ├── jquery-validation-unobtrusive │ │ ├── LICENSE.txt │ │ ├── jquery.validate.unobtrusive.min.js │ │ └── jquery.validate.unobtrusive.js │ │ ├── jquery-validation │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.min.js │ │ │ └── jquery.validate.min.js │ │ ├── bootstrap │ │ ├── LICENSE │ │ └── dist │ │ │ └── css │ │ │ ├── bootstrap-reboot.min.css │ │ │ └── bootstrap-reboot.css │ │ └── jquery │ │ └── LICENSE.txt ├── appsettings.json ├── appsettings.Development.json ├── _Imports.razor ├── Blazor.Web.csproj ├── Program.cs ├── APIControllers │ └── WeatherForecastController.cs ├── Properties │ └── launchSettings.json └── Startup.cs ├── Blazor.SPA ├── Pages │ ├── Index.razor │ ├── Counter.razor │ ├── Form3.razor │ ├── Form2.razor │ ├── BasicFetchData.razor │ ├── Form4.razor │ ├── FetchData.razor │ ├── Form.razor │ └── RouteViewer.razor ├── Shared │ ├── RedLayout.razor │ ├── SurveyPrompt.razor │ ├── MainLayout.razor │ ├── NavMenu.razor.css │ ├── RedLayout.razor.css │ ├── MainLayout.razor.css │ └── NavMenu.razor ├── App.razor ├── Data │ └── WeatherForecast.cs ├── _Imports.razor ├── Services │ ├── IWeatherForecastService.cs │ ├── WeatherForecastAPIService.cs │ ├── WeatherForecastServerService.cs │ └── RouteViewService.cs ├── Utilities │ ├── TypeSwitch.cs │ └── Utils.cs ├── Blazor.SPA.csproj ├── wwwroot │ └── index.html ├── Program.cs ├── Properties │ └── launchSettings.json └── Components │ └── RouteView │ ├── ViewData.cs │ ├── CustomRouteData.cs │ ├── RouteNotFoundManager.cs │ ├── RouteNavLink.cs │ └── RouteViewManager.cs ├── readme1.md ├── CEC.Blazor.RouteView.sln ├── .gitattributes └── .gitignore /Blazor.Web/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Blazor.Web/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShaunCurtis/CEC.Blazor.RouteView/HEAD/Blazor.Web/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Blazor.Web/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Blazor.Web 2 | @namespace Blazor.Web.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /Blazor.SPA/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @page "/index" 3 | 4 |
Use this page to detail your site's privacy policy.
9 | -------------------------------------------------------------------------------- /Blazor.Web/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Blazor.Web/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /Blazor.Web/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /Blazor.Web/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft": "Warning", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /readme1.md: -------------------------------------------------------------------------------- 1 | # Blazor AllinOne Project 2 | 3 | This repository contains the code for the Blazor AllinOne project. 4 | 5 | There's an article on my Personal Github Site to accompany this Repo - [How to build a single Blazor Application the runs in both WASM and Server Modes](https://shauncurtis.github.io/articles/Blazor-AllinOne.html). -------------------------------------------------------------------------------- /Blazor.Web/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page "/index" 2 | @model IndexModel 3 | @{ 4 | ViewData["Title"] = "Home page"; 5 | } 6 | 7 |Learn about building Web apps with ASP.NET Core.
10 |Current count: @currentCount
6 | 7 | 8 | 9 | @code { 10 | private int currentCount = 0; 11 | 12 | private void IncrementCount() 13 | { 14 | currentCount++; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Blazor.Web/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 8 | @using Microsoft.JSInterop 9 | @using Blazor.SPA 10 | @using Blazor.SPA.Shared 11 | -------------------------------------------------------------------------------- /Blazor.Web/Blazor.Web.csproj: -------------------------------------------------------------------------------- 1 |Sorry, there's nothing at this address.
8 |
13 | Request ID: @Model.RequestId
14 |
19 | Swapping to the Development environment displays detailed information about the error that occurred. 20 |
21 |22 | The Development environment shouldn't be enabled for deployed applications. 23 | It can result in displaying sensitive information from exceptions to end users. 24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 25 | and restarting the app. 26 |
27 | -------------------------------------------------------------------------------- /Blazor.Web/Pages/WASM.cshtml: -------------------------------------------------------------------------------- 1 | @page "/wasm" 2 | @{ 3 | Layout = null; 4 | } 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |This component demonstrates fetching data from the server.
8 | 9 | @if (forecasts == null) 10 | { 11 |Loading...
12 | } 13 | else 14 | { 15 || Date | 19 |Temp. (C) | 20 |Temp. (F) | 21 |Summary | 22 |
|---|---|---|---|
| @forecast.Date.ToShortDateString() | 29 |@forecast.TemperatureC | 30 |@forecast.TemperatureF | 31 |@forecast.Summary | 32 |
This component demonstrates fetching data from the server.
7 | 8 | @if (forecasts == null) 9 | { 10 |Loading...
11 | } 12 | else 13 | { 14 || Date | 18 |Temp. (C) | 19 |Temp. (F) | 20 |Summary | 21 |
|---|---|---|---|
| @forecast.Date.ToShortDateString() | 28 |@forecast.TemperatureC | 29 |@forecast.TemperatureF | 30 |@forecast.Summary | 31 |