ryudice
ryudice

Reputation: 37366

Problem with custom route

I've been trying to create a route that maps to /Controller/Update/Customer/1 without success, I've tried

routes.MapRoute("Scaffolding", "{controller}/{action}/{entity}/{id}");

this is the first route, but even that way doesnt seem to match this request: http://localhost:7290/Scaffolding/Update/Customer/1

Upvotes: 0

Views: 134

Answers (1)

nickmoriarty
nickmoriarty

Reputation: 1263

It looks like you are missing where the route is supposed to go to. an example is:

routes.MapRoute(
            "Scaffolding",                                            
            "{controller}/{action}/{entity}/{id}",                           // URL with parameters
            new { controller = "Scaffolding", action = "Update", entity = "Customer", id = "" }  // Parameter defaults
        );

You need to put the default parameters for that route in.

Upvotes: 1

Related Questions