Skip to content

Commit 36bd41d

Browse files
Modify-Blazor-server-samples
1 parent 592e385 commit 36bd41d

File tree

91 files changed

+3119
-3313
lines changed

Some content is hidden

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

91 files changed

+3119
-3313
lines changed
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
<Router AppAssembly="@typeof(Program).Assembly">
1+
<Router AppAssembly="@typeof(App).Assembly">
22
<Found Context="routeData">
33
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
4+
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
45
</Found>
56
<NotFound>
7+
<PageTitle>Not found</PageTitle>
68
<LayoutView Layout="@typeof(MainLayout)">
7-
<p>Sorry, there's nothing at this address.</p>
9+
<p role="alert">Sorry, there's nothing at this address.</p>
810
</LayoutView>
911
</NotFound>
1012
</Router>

Getting-Started/Blazor/Server-side-application/Create-Word-document/Create-Word-document.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<RootNamespace>Create_Word_document</RootNamespace>
58
</PropertyGroup>
69

710
<ItemGroup>

Getting-Started/Blazor/Server-side-application/Create-Word-document.sln renamed to Getting-Started/Blazor/Server-side-application/Create-Word-document/Create-Word-document.sln

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.31205.134
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.11.35327.3
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Create-Word-document", "Create-Word-document\Create-Word-document.csproj", "{B6BEE2B9-B374-42A9-8ABB-7DEAE110C311}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Create-Word-document", "Create-Word-document.csproj", "{C262669B-FA9F-4CA5-8D2F-CC99222670F5}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
1111
Release|Any CPU = Release|Any CPU
1212
EndGlobalSection
1313
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{B6BEE2B9-B374-42A9-8ABB-7DEAE110C311}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15-
{B6BEE2B9-B374-42A9-8ABB-7DEAE110C311}.Debug|Any CPU.Build.0 = Debug|Any CPU
16-
{B6BEE2B9-B374-42A9-8ABB-7DEAE110C311}.Release|Any CPU.ActiveCfg = Release|Any CPU
17-
{B6BEE2B9-B374-42A9-8ABB-7DEAE110C311}.Release|Any CPU.Build.0 = Release|Any CPU
14+
{C262669B-FA9F-4CA5-8D2F-CC99222670F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{C262669B-FA9F-4CA5-8D2F-CC99222670F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{C262669B-FA9F-4CA5-8D2F-CC99222670F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{C262669B-FA9F-4CA5-8D2F-CC99222670F5}.Release|Any CPU.Build.0 = Release|Any CPU
1818
EndGlobalSection
1919
GlobalSection(SolutionProperties) = preSolution
2020
HideSolutionNode = FALSE
2121
EndGlobalSection
2222
GlobalSection(ExtensibilityGlobals) = postSolution
23-
SolutionGuid = {A9EE6A51-6544-4C80-BF9B-6B779EF13098}
23+
SolutionGuid = {163F55FC-C04E-49AB-9EAF-9A43307447AD}
2424
EndGlobalSection
2525
EndGlobal
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
31
namespace Create_Word_document.Data
42
{
53
public class WeatherForecast
@@ -10,6 +8,6 @@ public class WeatherForecast
108

119
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
1210

13-
public string Summary { get; set; }
11+
public string? Summary { get; set; }
1412
}
1513
}

Getting-Started/Blazor/Server-side-application/Create-Word-document/Data/WeatherForecastService.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
using System;
2-
using System.Linq;
3-
using System.Threading.Tasks;
4-
51
namespace Create_Word_document.Data
62
{
73
public class WeatherForecastService
@@ -13,12 +9,11 @@ public class WeatherForecastService
139

1410
public Task<WeatherForecast[]> GetForecastAsync(DateTime startDate)
1511
{
16-
var rng = new Random();
1712
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast
1813
{
1914
Date = startDate.AddDays(index),
20-
TemperatureC = rng.Next(-20, 55),
21-
Summary = Summaries[rng.Next(Summaries.Length)]
15+
TemperatureC = Random.Shared.Next(-20, 55),
16+
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
2217
}).ToArray());
2318
}
2419
}

Getting-Started/Blazor/Server-side-application/Create-Word-document/Data/WordService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Syncfusion.DocIO;
1+
using Syncfusion.DocIO;
22
using Syncfusion.DocIO.DLS;
33
using System.IO;
44

@@ -75,4 +75,4 @@ public MemoryStream CreateWord()
7575
}
7676
}
7777
}
78-
}
78+
}

Getting-Started/Blazor/Server-side-application/Create-Word-document/FileUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Microsoft.JSInterop;
1+
using Microsoft.JSInterop;
22
using System;
33
using System.Collections.Generic;
44
using System.Linq;
@@ -14,4 +14,4 @@ public static ValueTask<object> SaveAs(this IJSRuntime js, string filename, byte
1414
filename,
1515
Convert.ToBase64String(data));
1616
}
17-
}
17+
}

Getting-Started/Blazor/Server-side-application/Create-Word-document/Pages/Counter.razor

Lines changed: 0 additions & 16 deletions
This file was deleted.

Getting-Started/Blazor/Server-side-application/Create-Word-document/Pages/DocIO.razor

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@page
2+
@model Create_Word_document.Pages.ErrorModel
3+
4+
<!DOCTYPE html>
5+
<html lang="en">
6+
7+
<head>
8+
<meta charset="utf-8" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
10+
<title>Error</title>
11+
<link href="~/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
12+
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
13+
</head>
14+
15+
<body>
16+
<div class="main">
17+
<div class="content px-4">
18+
<h1 class="text-danger">Error.</h1>
19+
<h2 class="text-danger">An error occurred while processing your request.</h2>
20+
21+
@if (Model.ShowRequestId)
22+
{
23+
<p>
24+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
25+
</p>
26+
}
27+
28+
<h3>Development Mode</h3>
29+
<p>
30+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
31+
</p>
32+
<p>
33+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
34+
It can result in displaying sensitive information from exceptions to end users.
35+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
36+
and restarting the app.
37+
</p>
38+
</div>
39+
</div>
40+
</body>
41+
42+
</html>

0 commit comments

Comments
 (0)