0

我在 Global.asax.cs 中定义了以下路由:

void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

    // catalog 
    routes.MapRoute("thumbs", "Thumbnail/{extn}/{image}/{width}/{height}", new
    {
        controller = "Image",
        action = "FetchThumbnail",
        extn = "gif",
        image = MediaManager.DefaultImageGuid,
        width = 250,
        height = 200
    });
    routes.MapRoute("rfqlist", "Rfqs/", new { controller = "RfqList", action = "Index" });
    routes.MapRoute("TappDefault", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }
    );
}

我无法通过并看到他们正在注册。我有一个控制器:

 public class RfqListController : TappController

  public ActionResult Index(string rfqTitle, int? page)

如果我打电话

> https://localhost:44300/rfqlist

它会触发,但如果我打电话:

> https://localhost:44300/rfqs

它是 404s。我看不到我做错了什么。这通常很容易。

4

1 回答 1

1

你有 rfqs 控制器吗?

https://localhost:44300/rfqs匹配指向 rfqs 控制器的 Index 操作的默认路由(“TappDefault”)

于 2013-10-20T22:29:05.733 回答