Category "razor-pages"

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

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