4
I have a route problem(again), I use the ASP.NET MVC5, and I have the following route mapped:
routes.MapRoute(
"Search_route",
"Home/Search/{search_input}/{search_input_category}",
new {
controller = "Home",
action = "Search",
search_input = UrlParameter.Optional,
search_input_category = UrlParameter.Optional
}
);
If I apply: Url.Action("Search", "Home", new { search_input = "casa", search_input_category = "vetores" })
my return will be: /Home/Search/home/vectors. But when trying to use this route in the following form:
@using (Html.BeginForm("Search", "Home", FormMethod.Get, new { @class = "search-form" })){
//Todos os campos de input devidamente nomeados
}
When I request my url returns /Home/Search? search_input=Casa&search_input_category=vectors That is, the route is correct, but it is not being applied in the <form>
for some reason. It is possible to apply the route to the form in some way?