开发者

Custom RouteMap

开发者 https://www.devze.com 2023-04-10 06:01 出处:网络
Hi I have to route an old path, that was containing the old webform, to my new controller. I tried this:

Hi I have to route an old path, that was containing the old webform, to my new controller.

I tried this:

            routes.MapRoute(
            "DownloadLink",
            "products/pippo/download/{*catchall}",
            new { controller = "Downloads", action = "Index"} 
            );

To have my controller called with http://mysite.com/p开发者_开发知识库roducts/pippo/download/ but what I receive it's a 404 Status Code, what am I doing wrong?

Thanks in advance


Put the DownloadLink route registration before all the other routes registrations in your Global.asax RegisterRoutes method.

0

精彩评论

暂无评论...
验证码 换一张
取 消