Category "razor-pages"

Keep ModelState After Redirect inside ExceptionFilterAttribute

I have a Mediatr pipeline behaviour which handles validation as a cross cutting concern, using FluentValidation it throws a ValidationException containing the v

Razor page change image within form by setting a checkbox

On a razor form submit page I would like to change a picture when a checkbox is set, before the form is posted though not trough JavaScript, but by pure razor c

Razor Pages Cannot Read File with build action "Content" Properties

I have a resources file name "Index.en-US.resx", initially it was "embedded resources" build action and it worked well in localization. But when it is "embedded

Is it possible to use a dynamic value in asp-route-{value}?

I have Razor Page with the following piece of code to create a link that adds a dynamic value to the route when clicked. This works perfectly. <a class="page

How to show a custom 404 page instead of default by Browser? When I'm using my Razor Pages Application

If you type http://google.com/ShowMeYourCustom404Page in your browser and then press Enter. You will be redirect to Google 404 Page. If we apply the same conce

Does RuntimeCompilation of Razor templates on iOS work (with xamarin)?

For a project I have to know whether runtime compilation of razor templates on iOS (xamarin) devices would work. Right now I have no emulator or iOS device avai

How to use anchor tag as submit button in asp.net razor pages

I have a handler method in razor page with name OnGetExpense(UsePayload payload) page.cshtml: <input type="hidden" asp-for="Filters.From" value="@Model.Filte

Foreign Key word display blank when the app is run

I have built a Book app in ASP.NET Core razor pages CRUD using Entity Framework. However, when I run the app and view it on https://localhost:44370/, the Foreig

ASP.Net Core Razor model validation for a <select> element

I have a .Net Core web application and I am trying to get the model validation to work as I want. The razor code is <div class="form-group"> <l

ASP.NET Core MVC - posting to a different action name does not bind the values

I'm using a regular html form instead of @html.BeginForm and I have these 2 form tags in my Create.cshtml view file. I was experimenting with routing, but my po

Razor Pages .Net Core - cannot upload large Files / Videos

I am trying to 'upload' a video file in to my application and pass it to the database. I am able to handle pictures quite nicely however as soon as I try larger

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