ASP.NET MVC multiple query string parameter
How do I design my URL to match my function like this:
public开发者_JAVA百科 ActionResult GetStuff(string name, string address, double latitude, double longitude)
{ }
Add a route with a signature that has all those parameters in it.
routes.MapRoute("myRoute",
"{controller}/{action}/{name}/{address}/{latitude}/{longitude}",
new { controller = "Home",
action = "GetStuff",
latitude=0.0,
longitude =0.0, address="", name = "" }
);
If you just intend to POST data to that action method, then the parameter names in your method signature can just match named input fields on your form instead.
精彩评论