ASP.Net MVC 5 Routing wildcard + querystring -


i using route filter

[route("search/{*segments}")] 

this takes segments providing many.

here example

http://localhost:50877/search/c_50_showcases%5e-displays/a_brand-name:33113319_balt:1623762%7cmooreco:1672386/a_total-number-of-shelves:33111115429_5:3138:lt/so_ts 

now need query string route unable make work.

http://localhost:50877/search/?query=hp%20designjet&items=hew51645a|eli75220 

it gives me 403 error.

the web server configured not list contents of directory

how can make route can take wildcard , query string handle incoming request. bound use search in route.

also tried

http://localhost:50877/search/test?query=hp%20designjet&items=hew51645a|eli75220 

it works effects seo.

defining action , route way:

[system.web.mvc.route("search/{*segments}")] public actionresult search(string segments, string query, string items) 

allows wildcard (in segments variable) , query string parameters (query , items)


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -