I am new to Blazor and looking what are the possibilities with this. I would like to migrate my asp.net website to blazor. I actually have urls like this :
www.mywebsite.fr/product/a-12
www.mywebsite.fr/product/details/a-12
www.mywebsite.fr/toto/tata/titi/b-9
But in the following documentation url, it seems that Blazor doesn't manage urls with regex. https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing?view=aspnetcore-7.0
I tried the following directive :
@page "/product/{Id:regex(^a\-\d{1,2}$)}"
but without success :(
Am I wrong ? If not, how can I do ?
You can catch all routes and handle it at component level:
After having
PageRouteyou can then decide, based on regex, to navigate user away, or process with request. In case above, if your route beproduct/123/456/a-2,PageRouteparamater will be123/456/a-2.