attributerouting - Forward slash in attribute routing regex -


i trying write regex matches route action. there seems problem forward slash.

this works:

[route("{url:regex((da|en))}")] www.mydomain.com/products/en  [route("{url:regex((da|en)something)}")] www.mydomain.com/products/ensomething 

this not:

[route("{url:regex((da|en)/something)}")] www.mydomain.com/products/en/something 

it looks regex lets match single segment of url, while presence of forward slash makes en/something 2 separate segments, i.e. en , something.

try attribute instead:

[route("{url:regex((da|en))}/something")] 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -