Click here to Skip to main content
15,886,647 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
All routing examples are using with '/' character
for example:

/{category}/{product}/{id}

/computer/mainboard/13

is it possible use a comma ',' instead of '/'
for example:

/{category},{product},{id}

/computer,mainboard,13


thanks

What I have tried:

in startup.cs

public void ConfigureServices(IServiceCollection services)
{
    services.AddRazorPages(opt =>
    {
        opt.Conventions.AddPageRoute("/Category", "{title},category");
    });
}
Posted
Updated 6-Dec-19 3:41am
Comments
MadMyche 5-Dec-19 17:17pm    
What happened when you tried that?

1 solution

According to this StackOverflow thread[^], that should work providing that all parameters are specified.

However, it's not a widely used URL format, and it's not recommended.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900