+1  A: 

You could try:

<% using (Html.BeginRouteForm("ProductSearchRoute", FormMethod.Get)) %>

Kindness,

Dan

Daniel Elliott
This is 1/2 way there. It still creates the querystring "?": http://localhost:8820/Products/Search/?searchQuery=test
Alex
Basically, how do I get it to understand that my input "searchQuery" corresponds to /Products/Search/{searchQuery} <-- put the value instead of {searchQuery}
Alex
I'm pretty sure there's no way to do this. The HTML Helper methods render a form tag to the browser - but there's nothing that would alter the target attribute of the form based on user input that comes *after* the form is rendered. You'll need to use javascript I think.
womp
Hmm, yes I think you're right.. I need to see if I can do with with jQuery intercepting the submit.. arghh
Alex
/me defers to Womp; could not put it better :)
Daniel Elliott
You *could* have an interim action method that took the querystring and Redirects to a prettier URL? eg /abc/xyz/?something=hij and redirect to /abc/xyz/hij
Daniel Elliott
@Dan I wish I could do that with MapRoutes
Alex
I've not tried writing a route as such with the ? in it (interesting!); I'll give it a go a little later and see.
Daniel Elliott
@Dan: Any success?
Alex
No dice; a juicy 500 page and URL cannot contain a ?. Short, informal but informative from the ASP.NET compiler ;)
Daniel Elliott
+3  A: 

If I understand you correctly, you're trying to dynamically alter the location the form posts to, based on the inputs of the form?

You'll need to use javascript for this, to alter the form's target attribute. The BeginForm() is for rendering the form tag, which from an html perspective, is static.

womp