How to create right MapRoute with my extension? (e.x. "my"). This MapRoute is correct
routes.MapRoute(
name: "Default",
url: "{controller}.my/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
But I want use controller.my?id. This MapRoute is wrong
routes.MapRoute(
name: "",
url: "{controller}.my/{tid}",
defaults: new { controller = "Home", action = "Index", tid = UrlParameter.Optional }
);
I think that if you add parameters in MapRoute, you can't simply use them as query strings.
Remove those parameters which you want to use them as query strings from MapRoute, and simply use them in action methods:
Action method:
So you can access that by something like
~/Home.my?tid=someThing