I’m converting a classic ASP page to ASP.NET MVC 2.
I have a simple form on the page that runs a search. Here’s the code:
<form id="searchbox" action="/search.asp">
<input type="text" name="q" />
<input type="submit" value="go" name="sa" />
</form>
The “/search.asp” page will stay, my new MVC page will just use it. So the form will perform a GET to the url. I’m not sure exactly how to handle a view user control.
Since this isn’t Web Forms where you can only have one server form, should I just leave the HTML as is? Or should I hook it up to a controller that will redirect to “/search.asp” with parameters in the query string?
I’m still new to MVC and I couldn’t find many resources on view user controls, maybe I’m not searching correctly.
If it is the legacy application handling the submission simply leave the form as is because the user will be redirected to this page anyways. When the time comes to migrate the search logic to ASP.NET MVC you may start worrying about user controls, controllers, etc…