razor-pages Questions

2

Possible Duplicate, but I've been unable to find anything on this. I have an asp.net core MVC project, which makes use of normal views using Razor. I have some ViewModel objects with nullable refer...
Unwilled asked 1/11, 2020 at 21:40

3

is it possible to create something like an extension for Visual Studio 2019 that adds custom scaffolding razor pages to an ASP.Net project? I want to create some templates which can be used on seve...

7

Solved

In VS 2017, I created a new ASP.NET Core Web Application. On the second page of the wizard, I chose Web Application, and for Authentication, I chose "Individual User Accounts". Now, I'm t...
Afb asked 11/6, 2018 at 17:1

2

Solved

I have a razor page which displays company and list of staff: @page "/admin/companies/editor/{id}" @model EditorModel @{ } <h1>admin . companies . editor</h1> <h4>Id ...
Dolorisdolorita asked 7/12, 2020 at 13:38

2

Solved

In Razor Pages cshtml files, can someone tell me what is the difference between the following: @functions { // Etc. } And: @{ // Etc. } It almost seems like the same thing.
Theran asked 21/3, 2020 at 19:14

3

Solved

In Razor Pages, it is quite convenient that if you were to call, for example, http://localhost/foo?bar=42 In the corresponding model, the bar key is automatically accessible in the OnGet constr...
Upmost asked 14/2, 2020 at 18:41

5

Solved

I want to get the full URL, not just the Path, not just the Query, and not RouteValues. The entire URL as it has come in the raw form. How can I do that in ASP.NET Core Razor Pages?
Panicstricken asked 26/12, 2021 at 8:52

2

I'm using the Asp.Net Core Razor Pages for one of my static website. I have one drop-down on my page and I bind it using the following code. [BindProperty] public string selectedFilter { get; se...
Shipowner asked 2/12, 2019 at 12:3

7

Here i have used two checkbox <label asp-for="SendReport" class="checkbox-inline"><input type="checkbox" asp-for="SendReport" />Send Report</label><br> <label asp-for="S...
Aden asked 31/10, 2018 at 7:10

4

Solved

I know lots of people asked this but none have solved my issue, please look at the simple two code snippets, I'm using dotnet core 2.2. What's wrong with the way I'm setting the data inside of View...
Heresy asked 25/2, 2019 at 13:4

2

Solved

Is there any way to trigger ASP.NET Core client-side validation from JavaScript? I have a Razor Pages page with a <form> that includes content like this: <div class="row"> &l...
Valorize asked 29/9, 2020 at 21:2

4

On a ASP.NET Core Razor Page we can do this to change the default folder-based route: @page "/xxx/yyy" but trying to do this with a strongly typed property in some class Constants.Routes does no...
Sasaki asked 1/3, 2019 at 9:23

1

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 VS2022 the warning message disappeared, an...
Frolic asked 6/2, 2022 at 6:45

4

Solved

Expanding the answer in this question: Change routing in ASP.NET Core Identity UI? Javier recommends one of the following options when wanting to customise the URLs: Use the scaffolding el...

3

Solved

Im trying to create a breadcrumb navigation, i.e. Home > Contact I have found this answer - link But it seams to be for MVC rather than razor pages. And i cant seam to find anything that works ...
Bennettbenni asked 31/8, 2018 at 16:24

5

Solved

Here I have a razor cs page: public IActionResult OnPost(){ if (!ModelState.IsValid) { return Page(); } return RedirectToPage('Pages/index.cshtml'); } And a cshtml page: @page @using Ra...
Mantoman asked 23/8, 2017 at 4:3

4

Solved

I am quite new to asp.net core development and I really don't know much of javascript, I am trying to know if there is some way to handle input events like OnClick() or OnChange() of Html inputs us...
Collyer asked 17/5, 2020 at 4:1

2

I'm new to .NET Core 2.0 Razor pages, and I'm finding it difficult to solve my problem in a clean way. I create a simple login form in which the user must enter it's email and password. I use a mod...
Brag asked 3/5, 2019 at 16:29

2

Solved

I'm working on a dotnet 6 mvc application using RazorPages, and I'm having a problem with strange routing behavior. I have a RazorPage /Pages/News.cshtml This page is accessible using the default r...
Thomson asked 6/7, 2022 at 3:1

3

Solved

In asp.net core it is very easy to define the razor pages authorization for pages and folders as follows: services.AddMvc() .AddRazorPagesOptions(options => { options.Conventions.AuthorizePa...
Parlance asked 9/1, 2018 at 19:15

9

Solved

I'm using Visual Studio 2019 version 16.0.4, and I tried to create a view or a partial one on asp.net core 2.1 (in views folder) but I get an error There are no scaffolders supported for this i...

1

Solved

I am trying to get a new value for the Session Cookie for every new login. Basically, the value in the screenshot below should have a new random string every time a user logs in. This is to avoid S...
Contrastive asked 27/5, 2022 at 4:23

2

Solved

I have a .NET Blazor Server app and need to pass an object from one component to another. Both components are pages, meaning that they have @page directives with routes. I know how to use cascading...
Cartomancy asked 10/5, 2022 at 2:23

3

Solved

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 context) { context.Response.ContentType...

1

I a using the exact code here https://developers.sendinblue.com/reference/addcontacttolist-1 to add a user to a list. It all works, user is created/updated (if exists) then the user is added to the...
Armin asked 28/3, 2022 at 17:15

© 2022 - 2024 — McMap. All rights reserved.