We have several routes in our Global.asax.cs file, but one of them is not apparently being used.
// Search (NOT working).
routes.MapRoute(
"Search",
"search/{query}",
new { controller = "Search", action = "Index" });
// Homepage (I believe the problem could be here, but not sure).
routes.MapRoute(
"MainIndex",
"{language}",
new { controller = "Main", action = "Index", language = string.Empty });
When we do a search in the search form which action attribute is "/Search", the user is sent to the homepage and the URL in the address bar is "/Search?query=example+search".
The form action attribute is built in using this code:
<form id="form1" action="<%= Url.Action("Index", "Search") %>">
Seems right to me, but the action name should be "/search" instead of "/Search", right?