tags:

views:

44

answers:

1

How do I design my URL to match my function like this:

public ActionResult GetStuff(string name, string address, double latitude, double longitude)
{ }
+1  A: 

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.

womp
Brad Wilson