← Alle Projekte

🌐 WebApplication1

ASP.NET Core Razor Pages Web-Template

Stand: 29.04.2026
Pfad: D:\arbeit\git\WebApplication1

πŸ“‹ Beschreibung

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.

πŸ› οΈ Technologien

C# Programmiersprache
ASP.NET Core 8.0 Web Framework
Razor Pages UI-Pattern
Bootstrap 5 CSS Framework
jQuery JavaScript Library
jQuery Validation Form Validation

πŸ“ Projektstruktur

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

πŸ’» Code-Beispiele

WebApplication1.csproj

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

</Project>

Program.cs

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();

Pages/Index.cshtml

@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>

πŸ“ Hinweise

  • Standard ASP.NET Core 8.0 Template
  • Razor Pages Pattern fΓΌr serverseitige Rendering
  • Bootstrap 5 fΓΌr responsives Design
  • jQuery fΓΌr Client-Side Interaktionen
  • HTTPS-Redirection und HSTS aktiviert
  • Statische Dateien aus wwwroot/ ausgeliefert