Skip to main content

Questions tagged [asp.net-core-routing]

Questions about routing within ASP.NET Core

asp.net-core-routing
0 votes
1 answer
91 views

RedirectToAction with routeValues and Route Template adds query string

I'm doing a Post-Redirect-Get pattern here with a couple of controllers, and I'm having trouble with the RedirectToAction part. Here is some example code with the just the redirect part to show ...
Scuzzlebutt's user avatar
1 vote
1 answer
59 views

Route never hits properly

I have this method in a controller named SecureAPI. The route looks pretty simple, but whatever I do I can't seem to invoke it. Method: [Route("SecureAPI/SetOrderAsProcessedAsync/{uid}")] ...
Stein Lundbeck Tech's user avatar
0 votes
0 answers
94 views

C# register controller using custom IApplicationModelProvider

I was working on defining generic controller for my web application, similar to the one explained in this question. The difference is that, in my case, controller routing prefix can contain one (ie: /...
Goran Petrović's user avatar
3 votes
1 answer
1k views

Monolithic modular web application in .NET Core 7

I want to develop a web application separated in modules. Suppose, for example, one module for authentication, one for products catalog, one for products and one for customers. When using Visual ...
jstuardo's user avatar
  • 4,423
1 vote
1 answer
168 views

Can't RedirectToAction with Parameter when using MapControllerRoute

While having this route mapping: app.MapControllerRoute( "ViewAct", "Cont1/Act1/{id}/{title?}", new { controller = "Cont1", action = "Act", id = &...
buga's user avatar
  • 1,056
0 votes
1 answer
52 views

Having issues generating URLs for custom routes to include the users culture in the RouteValues

I'm trying to create a custom route which will include the users culture in the route (RouteValues). Using default routing convention everything works fine. I have the following controller: public ...
Felix's user avatar
  • 3
-1 votes
3 answers
626 views

How to create a Net Core Middleware to validate a route parameter

Using Net Core 7 I have Razor Pages with a culture route parameter: @page "/{culture:validculture}/about" I created a custom route constraint to check if culture has a valid value. When the ...
Miguel Moura's user avatar
  • 38.6k
2 votes
1 answer
420 views

Redirect to same page with an extra parameter

I am using Request Localization in a NET Core 7 and Razor Pages application: builder.Services.AddRazorPages(); builder.Services.Configure<RequestLocalizationOptions>(options => { options....
Miguel Moura's user avatar
  • 38.6k
0 votes
1 answer
631 views

Redirect to `error/404` on invalid culture or invalid route

On an NET Core 7 Razor Pages project I am using route localization. In Program.cs I have the following: builder.Services.Configure<RequestLocalizationOptions>(x => { x....
Miguel Moura's user avatar
  • 38.6k
0 votes
1 answer
2k views

Determine health check routes at runtime in ASP.NET Core 6

I added health checks to my ASP.NET Core 6 app, and everything is working properly. I need to determine (programmatically, at runtime) all the health check routes, e.g. /healthz, etc. I tried: // ...
lonix's user avatar
  • 17.7k
0 votes
1 answer
484 views

ASP.Net Core Razor with Blazor WASM and Wildcard URL

I'm creating a website with a Blazor WASM as the admin, and a Core Razor is the main site. I didnt have any problem so far mixing both, but on the main site I have a Wildcar url, that gets anything &...
Eduardo's user avatar
2 votes
1 answer
706 views

how can i load a dll and assign routing url to methods to use them as webAPI calls?

i'm writing an application in asp.net core with a set of webAPI defined usig MVC and routing attributes. Now i'd like to manage additionals functions but, as a plugin, i'm going to define them in a ...
Nicola Agostoni's user avatar
1 vote
1 answer
395 views

Change URL of Razor Class Library page from client project

I created a Razor Class library (v6). In the RCL I have a page at ~/Pages/Page1.cshtml, which is accessible at /Page1. But the RCL is for use in other projects, so I want a client project to be able ...
lonix's user avatar
  • 17.7k
0 votes
1 answer
720 views

Overload action method but different route template(with controller name and without controller name) in .net core 5 MVC

I have 2 action method and 1 view. I want send post request but with controller name after submit on the view. But open page without controller name. Controller public class ProductController : ...
Alizaman Habibli's user avatar
0 votes
2 answers
2k views

OData Controller withing Asp.Net Core MVC application

I'm working on a project in ASP .NET Core 3.1 MVC now I want to add some API controllers to return list of objects. For this I want to use OData Controller version 8.0.0 so I can get quarriable data ...
Anjum's user avatar
  • 9

15 30 50 per page
1
2 3 4 5
15