Open Daniel15 opened 11 years ago
Here's another one I pulled from my code:
context.MapRoute(
name: "BlogAdminPostsPublished",
url: "blog/admin/posts/published",
defaults: new { controller = "Blog", action = "Posts", published = true }
);
context.MapRoute(
name: "BlogAdminPostsUnpublished",
url: "blog/admin/posts/unpublished",
defaults: new { controller = "Blog", action = "Posts", published = false }
);
I can't work out how to route these at all.
I have the following ASP.NET MVC routing rules:
When used with
Url.Action
, this generates URLs like "/category/hello-world" when thepage
parameter is 1, otherwise it generates URLs like "/category/hello-world/page-2". How do I replicate this in AttributeRouting? I've got the following attributes:But my
Url.Action
calls are generating "/category/hello-world/page-1" for the first page.