Expected Behavior.
The routing system is located on the server side. The browser does not know anything about routes, and what you do happens in the browser.
If you want to get this route, you must compile it on the client side using a special script that uses the <form> action, the values ββof <input type="text"> .
You cannot generate Url on the server side (which can be done using some of the UrlHelper extension methods), since changes to text fields will not be updated.
This is impractical because if you make changes to the routes, you may forget to update them in your browser scripts, disrupting your application.
You can avoid this problem by creating a server-side URL using the UrlHelper extension method with special placeholders that can be easily replaced on the client side. That is, create a URL like this:
http://localhost/Pesquisar/$aaa$/$bbb$/$id$
providing RouteValues ββas follows: new {aaa="$aaa$, bbb="$bbb$, id="$id$"} to the UrlHelper method. This url can be stored in the value property of the hidden field.
Then make a browser script for the click event of your button, restore the URL with placeholders from the hidden field, and replace the placeholders with the actual values ββof the text fields. To complete this run, do the following: document.location = theUrl;
If you want this to be differentnt for many instances, you could create a Helper to bypass the hidden field using Url and javascript, which makes replacements.
The question is, is it worth the effort?