0
我使用MVC 2.0創建我的申請,我的問題I S相關的路由。 其實在我的應用程序的每個用戶都需要單獨的子網域,例如www.example.com/user1/,www.example.com /用戶2/... etc.the默認域是www.example.com.So我怎樣才能讓它可能與mvc路由。 我已經試過這樣的,ASp.Net MVC路由
routes.Add(new Route(
"{id}",
new RouteValueDictionary(
new { controller = "User", action = "login", id = " " }
), new MvcRouteHandler()));
var defaults = new RouteValueDictionary(
new
{
controller = "Home",
action = "Index",
id = UrlParameter.Optional
}
);
routes.Add(new Route(
"{controller}/{action}/{id}",
defaults,
new MvcRouteHandler()));
但問題是,它採取deafult(www.example.com)直接向用戶登錄page.I希望默認頁面首頁/指數,當www.example。 COM/USER1 /它會去用戶登錄page.Is有任何..pls辦法幫我
嗨米卡科拉里, 謝謝你的答案很好,它工作。 – suneehs 2010-05-07 06:31:56