1
How can I dynamically change a URL in a BD search of Id’s by NAME to become a friendlier URL (SEO).
My URL today:
http://meusistema.com.br/Achei/26/8717/1/2/3 - being the 26
=STATE, 8717
=CITY,1
=NEIGHBORHOOD, 2
=CATEGORY, 3
=BUSINESS
The URL I think is best for viewing:
http://meusistema.com.br/Achei/sao-paulo/sao-paulo/morumbi/casa/venda
The route on the Routes.Mappageroute is thus:
routes.MapPageRoute(
"AcheiCatNegRoute",
"Achei/{idestado}/{idcidade}/{idbairro}/{idcategoria}/{idnegocio}",
"~/Achei.aspx"
I think there should be a way for the URL to assume the name is not the ID without having to change the logic of the database, I believe that to search for the ID is faster than for a String, I appreciate any help.
Note: I also use Webforms with Asp.NET and SQL.
as you will be passing a String in Routedata, then you will need to do your SQL search using strings, what can be done to ease your situation is to add an Input to the affected columns.
– Tobias Mesquita
Are you using MVC? Can you describe how Binding of parameters between the layer processing the request and the route?
– Leonel Sanches da Silva
Like it’s done in Controller?
– PauloHDSousa
Paulo is not MVC is Webforms
– WeberSP