Category "razor-pages"

Stuck at progressively migrate my website to Vue.js

I chose Vue.js over React and Angular, because it felt much more easier to migrate my existing website (old technologies, ASP.NET Razor Pages inside Visual Stud

Razor Pages SelectListItem not selected

I’m working on an ASP.net Razor Page and having a problem with the tag-helper for a select-list. Especialy with the selected-property of the SelectListIte

Script missing when implementing NetEscapades.AspNetCore.SecurityHeaders

I have implemented CSP and CORS when doing so my external script is not rendering on the page. builder.Services.AddCors(options => { options.AddPolicy(name:

Script missing when implementing NetEscapades.AspNetCore.SecurityHeaders

I have implemented CSP and CORS when doing so my external script is not rendering on the page. builder.Services.AddCors(options => { options.AddPolicy(name:

Cannot load System.Web.HttpContext error with razor pages and WebMail

I've been having trouble getting WebMail to work sending an email using a contact form using This Official Microsoft Tutorial. My current issue is that I'm get

Custom middleware breaks Developer Exception Page

Custom middleware breaks Developer Exeption Page. Instead of page with exception details there is HTTP 500 response. Debugging line by line runs only until awai

Get the value of /page/2 rather than using /page?id=2

I am using a razor page and want to get the value from the path. What is the correct way to do this using the razor page or do I have to parse the Http URL?

Calling Another Project's Controller From A Project In The Same Solution (.NET Core )

There are 2 projects in the same solution. First project is a .NET Core project and it has all the codes(controllers, models etc.) related to packages. I need t

How to fill attribute value from database on Razor Pages .netCore

I have an attribute above the action Method, the value of which must be filled from the database But I do not know how to do this I want to use this attribute i

How to load razor page before it's done rendering?

I have a table of records in Index.cshtml, once a user clicks on a record to view the details it will take them to Details.cshtml. The issue is, there is a lot

Link not rendering when using asp-page TagHelper

I have one page that does not render a link in HTML when using the asp-page TagHelper. I have seen this before, but it was due to a typo or the page not existi

ASP.NET Core Razor pages vs Full MVC Core [closed]

There has been a question at SO Why is Razor Pages the recommended approach to create a Web UI in Asp.net Core 2.0? where Steve Smith has kind

Call method in MainLayout from a page component in Blazor

I have a Blazor app with a MainLayout page, which has a @Body to load the actual page content. In my case Index.razor is loaded inside the MainLayout page. Is

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