I'm new to mvc, and I'm having trouble passing the value of a textbox to the controller method.
I've got:
in the aspx page:
<form action="/Search" method="post" > <input type="submit" value="search" name="id" />
global.asax:
routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}",
// URL with parameters new { controller = "myController", action = "Search", id = "" } // Parameter defaults
the url I need is
myController/Search/mySearchTerm
when I type this in manually it works fine. But when I press the submit button the url I get is:
myController/Search/Search
If I change the form method to get, I get
myController/Search/Search?id=search