textbox supplied route values with javaScript
- by Maslow
I've tried the bare method and the T4MVC method but so far both are routing me to the current URL instead of the default path with no arguments for the following action:
public virtual ActionResult Index(byte? location, int? sublocation)
{
}
So when I try
Url.Action("Index","Locations", new {location="", system=""})
if I'm at a location already this method returns the path to where I'm already at instead of the default path with no arguments. As does the following method with T4MVC.
<input type="button" value="Go" style="display:none" onclick="window.location='<%=
Url.Action(MVC.Controller.Index())
%>/'+$('input#location').val()+'/'+$('input#sublocation').val()+'/';" />
How can I get the default route with no arguments?