Category "razor-pages"

Optional section was not defined error in nested layout pages

I have a _Layout.cshtml file that contains the following line. @RenderSection("Scripts", required: false) And then I have a StorageLayout.cshtml file that spec

FluentValidation inside a MediatR pipeline and Razor Pages

I'm working on a project where everything is done through a mediatR pipeline. To make things easy the pipeline is this : -> Validation -> Handler The Vali

ASP.NET Razor Pages submit button does nothing

I have this view: @page @model TreesOnMars.Pages.NewGameModel @{ ViewData["Title"] = "New Game"; } <h2>New Game</h2> <form method="POST"&g

Confuse about Nuget and Libman in VS2022

I am new to .NET Core web development. In VS2017, when I install jQuery using Nuget, a message will be shown suggesting to use Libman instead. However, in VS202

IList returning count=0 on posting back updated checkboxes

I'm using asp.net-core with razor pages. I'm trying to update the checkboxes in the table. When clicking on button save I pass with asp-route-for because I wan

How to directly set response body to a file stream in ASP.NET Core middleware?

Sample code below to write a file stream to Response.Body in an ASP.NET Core middleware doesn't work (emits empty response): public Task Invoke(HttpContext con