Route issue with one parameter RRS feed

  • Question

  • Hi everyone.

    I have a website developed in Web Forms and I'm using Routes to use friednly URLs. 

    It's working fine, but with a specific page I have a issue:

    I have the page of Categories named detailcategorias.aspx and the mapRoute is: 

    routes.MapPageRoute("Categories", "{urlCategoria}", "~/detailcategoria.aspx");

    By this I can access https://mysite.com/shoes

    The issue is: when I access ANY page (ex.: default, contact, etc) it goes to my detailcategoria.aspx page and after that, load the correct page. 

    Searching the internet, I found some solution, that is to add something before the paramenter. Something like this:

    routes.MapPageRoute("Categories", "c/{urlCategoria}", "~/detailcategoria.aspx");

    But with this, I need to access https://mysite.com.br/c/shoes

    My question is: is there any way to use just {urlCategoria} in the second parameter of MapPageRoute with occuring this issue?

    Thanks in advance!

    • Moved by CoolDadTx Thursday, October 5, 2017 3:45 PM ASP.NET related
    Thursday, October 5, 2017 2:26 PM

All replies