Hi guys, Yet another newbie with ASP.NET MVC! All I intend to do is for a search textbox on my page, if I type something and click search, the url to be redirected to should have the following at the end, like in stackoverflow,
/search?q=searchedtext
So here is what I have now,
<input id="searchText" maxlength="100" type="text" name="query" />
<a href="???" class="searchButton">
Search
</a>
I have a function in my controller like this,
public ActionResult Search(string query)
{
}
Here is the route,
routes.MapRoute(
"Search",
"Search",
new { controller = "Posts", action = "Search"}
);
Can anyone fill in the gaps here :). Any comments appreciated.