Skip to content

Commit 88f2ffa

Browse files
Static SSR
1 parent 638c7b8 commit 88f2ffa

File tree

4 files changed

+42
-17
lines changed

4 files changed

+42
-17
lines changed

SSR with Global and Individual/Components/App.razor

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
<base href="/" />
88
<link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
99
<link rel="stylesheet" href="app.css" />
10-
<link rel="stylesheet" href="SSR with Global and Individual.styles.css" />
10+
@* <link rel="stylesheet" href="SSR with Global and Individual.styles.css" /> *@
1111
<link rel="icon" type="image/png" href="favicon.png" />
12+
<link rel="stylesheet" href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" />
1213
<HeadOutlet />
1314
</head>
1415

1516
<body>
1617
<Routes />
1718
<script src="_framework/blazor.web.js"></script>
19+
<script src="_content/Syncfusion.Blazor.Core/scripts/syncfusion-blazor.min.js"></script>
1820
</body>
1921

2022
</html>
Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
@page "/"
2+
@using Syncfusion.Blazor.Grids
23

34
<PageTitle>Home</PageTitle>
45

5-
<h1>Hello, world!</h1>
6+
<SfGrid DataSource="@Orders" AllowPaging="true" AllowSorting="true" AllowFiltering="true" AllowGrouping="true" />
67

7-
Welcome to your new app.
8+
@code {
9+
public List<Order> Orders { get; set; }
10+
11+
protected override void OnInitialized()
12+
{
13+
Orders = Enumerable.Range(1, 50).Select(x => new Order()
14+
{
15+
OrderID = 0 + x,
16+
CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],
17+
}).ToList();
18+
}
19+
20+
public class Order
21+
{
22+
public int? OrderID { get; set; }
23+
public string CustomerID { get; set; }
24+
25+
}
26+
}

SSR with Global and Individual/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
using SSR_with_Global_and_Individual.Components;
66
using SSR_with_Global_and_Individual.Components.Account;
77
using SSR_with_Global_and_Individual.Data;
8+
using Syncfusion.Blazor;
89

910
var builder = WebApplication.CreateBuilder(args);
1011

1112
// Add services to the container.
1213
builder.Services.AddRazorComponents();
1314

15+
builder.Services.AddSyncfusionBlazor();
1416
builder.Services.AddCascadingAuthenticationState();
1517
builder.Services.AddScoped<IdentityUserAccessor>();
1618
builder.Services.AddScoped<IdentityRedirectManager>();
Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<UserSecretsId>aspnet-SSR with Global and Individual-394cbc01-aa5a-4e77-b769-1d2837976a33</UserSecretsId>
8-
<RootNamespace>SSR with Global and Individual</RootNamespace>
9-
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
10-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<UserSecretsId>aspnet-SSR with Global and Individual-394cbc01-aa5a-4e77-b769-1d2837976a33</UserSecretsId>
8+
<RootNamespace>SSR with Global and Individual</RootNamespace>
9+
<AssemblyName>$(AssemblyName.Replace(' ', '_'))</AssemblyName>
10+
</PropertyGroup>
1111

12-
<ItemGroup>
13-
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
15-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
16-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0" />
17-
</ItemGroup>
12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.0" />
14+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
15+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
16+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0" />
17+
<PackageReference Include="Syncfusion.Blazor.Themes" Version="23.2.4" />
18+
<PackageReference Include="Syncfusion.Blazor.Grid" Version="23.2.4" />
19+
</ItemGroup>
1820

1921
</Project>

0 commit comments

Comments
 (0)