added asp-controller to editserver.cshtml + using id in edtiserver as hidden

This commit is contained in:
2025-07-30 11:14:17 +02:00
parent b0c99b17cf
commit f24e02c8b4
3 changed files with 46 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
@model Watcher.ViewModels.EditServerViewModel;
@model Watcher.ViewModels.EditServerViewModel
@{
ViewData["Title"] = "Server bearbeiten";
@@ -6,26 +6,28 @@
<h2>Server bearbeiten</h2>
<form asp-action="EditServer" method="post">
<form asp-action="EditServer" asp-controller="Server" method="post">
@Html.AntiForgeryToken()
<input type="hidden" asp-for="Id" />
<div class="mb-3">
<label asp-for="Name"></label>
<input asp-for="Name" class="form-control" />
<span asp-validation-for="Name" class="text-danger"></span>
</div>
<div class="mb-3">
<label asp-for="IPAddress"></label>
<input asp-for="IPAddress" class="form-control" />
</div>
<span asp-validation-for="IPAddress" class="text-danger"></span>
</div>
<div class="mb-3">
<label asp-for="Type"></label>
<input asp-for="Type" class="form-control" />
<span asp-validation-for="Type" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary mt-3">Speichern</button>
<a asp-action="Overview" class="btn btn-secondary mt-3">Abbrechen</a>
</form>
</form>