question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid route generation with multiple parameters

See original GitHub issue

My route is defined as follows:

config.RouteTable.Add("Calendar", 
    "kalendar/{Year:posint}/{Month:posint}",
    "Views/Calendar.dothtml", 
    new { Year = 0, Month = 0 });

I’m calling it from RouteLink control:

<dot:RouteLink RouteName="Calendar" Param-Month="" Param-Year="">...</dot:RouteLink>

The resulting URL is /kalendar// instead of just /kalendar/.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tomashercegcommented, Feb 15, 2017

I think we should replace sequences of multiple slashed with just one slash in the URL and make sure that it will match the route correctly. This should work the same as in MVC, so we should do a research how this thing works there and then adjust the behavior to be the same in DotVVM.

0reactions
tomashercegcommented, Jul 20, 2021

We’ve discussed this and we can validate the parameter constraints when generating the link (when the page is compiled), and maybe generate warnings when the parameter is data-bound.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Web API routing with multiple parameters
I have seen the WebApiConfig get "out of control" with hundreds of routes placed in it. Instead I personally prefer Attribute Routing.
Read more >
Use invalid route handle
This is a request with an invalid route handle that cannot be decoded: curl -X GET \ 'https://router.hereapi.com/v8/routes/InvalidRouteHandle?
Read more >
Attribute Routing in ASP.NET Web API 2
This topic discusses how to enable attribute routing in ASP.NET Web API 2 and describes various options for attribute routing.
Read more >
Routing in ASP.NET Core
Routing is responsible for matching incoming HTTP requests and dispatching those requests to the app's executable endpoints.
Read more >
URL Generation - Laravel 10.x - The PHP Framework For ...
To generate a URL to this route, you may use the route helper like so: ... helper may also be used to generate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found