ASP.NET Core Razor Pages Web-Template
Dies ist ein Standard ASP.NET Core Web-Template mit Razor Pages. Es handelt sich um eine moderne Web-Applikations-Struktur mit Bootstrap-Frontend, die als Basis fΓΌr .NET-Webanwendungen dient.
WebApplication1/ βββ .vs/ # Visual Studio Cache βββ WebApplication1/ β βββ Pages/ β β βββ Shared/ β β β βββ _Layout.cshtml # Haupt-Layout β β β βββ _Layout.cshtml.css # Layout-Styles β β β βββ _ValidationScriptsPartial.cshtml β β βββ Index.cshtml # Startseite β β βββ Index.cshtml.cs # Code-Behind β β βββ Privacy.cshtml # Datenschutzseite β β βββ Error.cshtml # Fehlerseite β β βββ _ViewImports.cshtml # View Imports β β βββ _ViewStart.cshtml # View Start β βββ wwwroot/ β β βββ css/site.css # Custom Styles β β βββ js/site.js # Custom Scripts β β βββ lib/ # Client Libraries β β β βββ bootstrap/ # Bootstrap 5.3 β β β βββ jquery/ # jQuery 3.7 β β β βββ jquery-validation/ # jQuery Validation β β β βββ jquery-validation-unobtrusive/ β β βββ favicon.ico β βββ Properties/ β β βββ launchSettings.json # Debug-Settings β βββ appsettings.json # App-Konfiguration β βββ appsettings.Development.json # Dev-Konfiguration β βββ Program.cs # Entry Point β βββ WebApplication1.csproj # Projektdatei βββ WebApplication1.sln # Solution-Datei
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddRazorPages();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.MapRazorPages();
app.Run();
@page
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about
<a href="https://learn.microsoft.com/aspnet/core">
building Web apps with ASP.NET Core
</a>.
</p>
</div>