Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC routes

I need help with this route map

routes.MapRoute("Blog_Archive", 
                "Blog/Archive/{year}/{month}/{day}",
                new { 
                      controller = "Blog",
                      action = "archive",
                      year = "",
                      month = "",
                      day = "",
                      page = 0
                    });

When I call http://localhost:5060/blog/Archive/2008/11, it picks up the year and month and sends it to the controller. But when I try http://localhost:5060/blog/Archive/2008
it sends it to the controller but the year parameter is null and so are all the other parameters.

like image 351
Nesizer Avatar asked Nov 10 '08 00:11

Nesizer


1 Answers

Do you have any other Route for Blog/Archive/{something}?

Use the Routing Debugger to see which route actually gets hit, most likely it's not hitting that route.

like image 167
Michael Stum Avatar answered Oct 11 '22 03:10

Michael Stum