【问题标题】:DomainRouting in vNext(Asp.net 5)Next中的域路由(Asp.net 5)
【发布时间】:2015-03-27 02:38:21
【问题描述】:

我想这样做

routes.MapRoute(
    name: "siteA",
    domain: "www.aaa.com", //Domain
    template: "{siteId}/{controller}/{action}/{id?}", //Url with siteId
    defaults: new { siteId = "1", controller = "Product", action = "Details" }); //domain(www.aaa.com)  match siteId=1

routes.MapRoute(
        name: "siteB",
    domain: "www.bbb.com",
    template: "{siteId}/{controller}/{action}/{id?}",
    defaults: new { siteId = "2", controller = "Product", action = "Details" }); //domain(www.bbb.com)  match siteId=2

routes.MapRoute(
    name: "siteC",
    domain: "www.ccc.com",   
    template: "{siteId}/{controller}/{action}/{id?}",
    defaults: new { siteId = "3", controller = "Product", action = "Details" }); //domain(www.ccc.com)  match siteId=3

谁能告诉我怎么做?

希望你能给我一些代码。

我知道有这样的方法:http://blog.maartenballiauw.be/post/2009/05/20/ASPNET-MVC-Domain-Routing.aspx

但我不知道如何在 vNext 中进行操作。

【问题讨论】:

  • 域路由尚未移植到新框架。我确实联系了业主并让他知道

标签: c# .net asp.net-mvc asp.net-core


【解决方案1】:

【讨论】:

    猜你喜欢
    • 2016-03-23
    • 2018-05-31
    • 1970-01-01
    • 1970-01-01
    • 2015-09-10
    • 2017-01-15
    • 2011-08-08
    • 1970-01-01
    • 2021-02-13
    相关资源
    最近更新 更多