I have a route defined as:
routes.MapRoute ("AllUsers",
"Users / Search / {Search}", new {Controller = "Users", action = "Index"});
and the form:
<% using (Html.BeginForm("Index", "Users/Search/", new { RouteValue = "AllUsers" }, FormMethod.Get, new { id = "searchForm" })){%>
<input id="searchBox" name="search" type="text" />
<input type="submit" id="submit" value="Search" /><%} %>
Currently, as expected, this creates a url
../Users/Search/?search=searchTerm
but I would like to:
../Users/Search/searchTerm
How is this possible? I was thinking about using javascript, but that seems a bit messy. Is there a better way to accomplish this?
source
share