2012-02-03 96 views

回答

0

你可以用這種方法去:

Is it possible to make an ASP.NET MVC route based on a subdomain?

或者你也可以做一個簡單的幫手:

public IHtmlString SubUrl(this UrlHelper urlHelper, string subDomain, string controller, string action, object options) { 
    return subDomain + urlHelper.Action(action, controller, options); 
} 

在查看:Url.SubUrl("my.domain.com", ...);