【问题标题】:Routing Url that has no action name没有动作名称的路由 URL
【发布时间】:2015-06-09 07:20:27
【问题描述】:

如何路由此网址 http://localhost:1986/en/Hotel/#forward

controller = "Hotel",
action = "Results"

由于用户从该页面登录时需要刷新该页面,因此我需要重定向到上述控制器/操作。

请帮忙

【问题讨论】:

    标签: asp.net-mvc-3 c#-4.0 routing


    【解决方案1】:

    我自己找到了一些解决方案

    routes.MapRoute(
       "HotelResultAfterFlightSelection1", // Route name
       "Hotel/Results/{tripid}", // URL with parameters
       new
       {
           controller = "Hotel",
           action = "Results",
           tripid = UrlParameter.Optional
       }
    );
    routes.MapRoute(
       "HotelResultAfterFlightSelection2", // Route name
       "Hotel", // URL with parameters
       new
       {
           controller = "Hotel",
           action = "Results"
       }
    );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-05
      • 2014-12-01
      • 2014-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-27
      相关资源
      最近更新 更多