The Question
Is there a way to alias the parameters generated by MVC, in my case it would be the searchTerm
param? For example, in my viewmodel it would still be SearchViewModel.searchTerm but the URL would look more like /Home/Search?s=jimmy
Search Form
<% using (Html.BeginForm("Search", "Home", FormMethod.Get)) {%>
<%: Html.TextBoxFor(model => model.searchTerm) %>
<input type="submit" value="Search" />
<% } %>
View Model
public class SearchViewModel
{
public string searchTerm { get; set; }
}
The URL Generated
/Home/Search?searchTerm=jimmy
Edit: Doesn't seem possible. Looks like I'll have to do it on my own..