【问题标题】:MVC3 Routing: Match to any stringMVC3 路由:匹配任何字符串
【发布时间】:2012-04-07 12:57:40
【问题描述】:

简单的问题:

如何匹配 MVC3 路由系统中的字符串?

例子:

{sub}.domain.com/{contoller}/{action}/{id}

sub = [Match any string here]

【问题讨论】:

    标签: asp.net-mvc-3 routing url-routing string-matching


    【解决方案1】:

    您的问题似乎是answered here

    基本上,要访问 {subdomain}.domain.com,正常的路由处理程序不会在那里查看,但您可以创建自己的自定义 Route 类,并将其注册到 Global.asax Application_Start() .

    【讨论】:

      猜你喜欢
      • 2015-08-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-08
      • 2017-10-27
      • 1970-01-01
      • 2012-03-14
      相关资源
      最近更新 更多