textbox supplied route values with javaScript
Posted
by Maslow
on Stack Overflow
See other posts from Stack Overflow
or by Maslow
Published on 2010-04-11T04:31:23Z
Indexed on
2010/04/11
4:33 UTC
Read the original article
Hit count: 421
asp.net-mvc
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?
© Stack Overflow or respective owner