Questions tagged [routes]

Questions about mapping URLs to Controllers and Actions.

MVC web application (like Ruby on Rails, ASP.NET MVC, etc) uses routes to map an arbitrary URL to a specific controller/action.

For example

http://example.com/foo/bar/23

Might pass an id 23 to controller foo, action bar.

Unusual URLs could also be mapped

Given controller places and intended action list, we can use routes to allow this URL:

http://example.com/my/places
32975 questions
6
votes
1 answer

Symfony 3.4/routing: Urlencoded "/" in the parameter value cause not matching the route

So, I will explain the problem and actual question will be if it's a Bug: $routes = new RouteCollection(); $context = new RequestContext('/'); $matcher = new UrlMatcher($routes, $context); $route = new…
user2227791
  • 324
  • 2
  • 5
6
votes
3 answers

Creating a System.Web.UI.Page programmatically in IHTTPHandler

I am trying to use the ASP.NET (3.5) "Routing Module" functionality to create custom pages based on the contents of the URL. Various articles explain how to use ASP.NET Routing to branch to existing pages on the web server. What I would like to do…
ObiWanKenobi
  • 14,526
  • 11
  • 45
  • 51
6
votes
1 answer

Angular 5 EmptyError: no elements in sequence while making child routes

I am not able to navigate from login page to dashboard page when I use children in routing as follows: const appRoutes: Routes = [ { path: '', redirectTo: 'login', pathMatch: 'full' }, { path: 'login', component: LoginComponent,pathMatch: 'full'…
A_J
  • 977
  • 4
  • 16
  • 44
6
votes
3 answers

How to change action parameters and get it to work without changing routing in asp.net mvc?

In my route I have something like this: controller/action/{id} To my knowledge this means it will call any action with the parameter id like the following: public ActionResult Detail(string id) { } What do I have to do to make the following…
johndoe
  • 185
  • 1
  • 1
  • 6
6
votes
2 answers

$request not working on laravel get method

I have a route Route::get('student-search', 'Students@search') and url on browser student-search?session=2&name=raj&grade=1§ion=a But while returning $request its returning empty . Same thing is working fine on local but not working after…
salin kunwar
  • 1,128
  • 3
  • 13
  • 22
6
votes
5 answers

ASP.NET MVC Colon in URL

I've seen that IIS has a problem with letting colons into URLs. I also saw the suggestions others offered here. With the site I'm working on, I want to be able to pass titles of movies, books, etc., into my URL, colon included, like…
Joe Morgan
  • 1,761
  • 6
  • 20
  • 29
6
votes
2 answers

Completely remove Leaflet route

How does one go about completely removing a route drawn previously using Leaflet Routing Machine? Either the docs here do not explain how this is done or I have somehow managed to miss it. Reading through the conversation here I am currently doing…
DroidOS
  • 8,530
  • 16
  • 99
  • 171
6
votes
2 answers

Laravel: POST method returns MethodNotAllowedHttpException

I have a POST route in my api.php file, and it is like this: Route::group( ['namespace' => 'api'], function () { Route::post('parent/signup', 'ParentController@signUp'); } ); And I am trying to access this url in postman as this is an api…
Saani
  • 791
  • 7
  • 28
  • 68
6
votes
3 answers

Route Group in Lumen error Call to undefined method Laravel\Lumen\Application::group()

I have declared a route group in laravel/lumen like so: $app->group(['middleware' => 'auth'], function () use ($app) { $app->get('/details', 'UserController@details'); }); all contents of route file web.php are like…
Shakti Phartiyal
  • 6,156
  • 3
  • 25
  • 46
6
votes
8 answers

IIS7 MVC Routing Not Working

Our company ships an MVC based product (targeting v4.5) which has stopped working on a customer site for what appear to be environmental issues - a build which worked with no problems once upon a time now gives a 403.14 - The Web server is…
amcdermott
  • 1,565
  • 15
  • 23
6
votes
1 answer

Angular 4 : Routing rule with an undefined number of parameters

I have an Angular 4 file browser system, getting the current folder content only. It's just like the dropbox website behaviour. The desired behaviour: I am able to display the current path in a breadcrumb. I would like to bind my breadcrumb with my…
Kapcash
  • 6,377
  • 2
  • 18
  • 40
6
votes
3 answers

Laravel 5.4 routing for same prefix group but different middleware giving error

I need all the route under same prefix manager with one middleware for guest manager_guest and another for logged in user manager_auth. This code bellow is my route web.php file. Is there any other way ? My…
Rakesh Roy
  • 930
  • 2
  • 12
  • 22
6
votes
2 answers

how to define two parameter in laravel route

im using laravel 5.4 and i have a brands and a products table. i want to define two parameter in route and get them in controller or RouteServiceProvider to search. imagine : site.com/samsung/ => get all products with samsung brand. and :…
K1-Aria
  • 1,093
  • 4
  • 21
  • 34
6
votes
1 answer

routerLink adding question mark in url?

I want to have route something like this : www.test.com?procesId=12 . This is my current routerLink: But right now i get this value : www.test.com/123 Any suggestion how can i add in url ?procesId = 12 with routerLink ? I tried: But i dont get…
None
  • 8,817
  • 26
  • 96
  • 171
6
votes
2 answers

String Route Constraint

I have an ASP .Net Core 1.1 MVC Web API. How can I have a string route constraint in a controller action? I have the following two actions: / GET: api/Users/5 [HttpGet("{id:int}")] [Authorize] public async Task GetUser([FromRoute] int…
1 2 3
99
100