的請求得到RouteCollection這是我的Global.asax(註冊路線)如何在ASP.NET MVC 4
routes.MapRoute("NewDatabase",
"Server/{serverId}/Instances/{instanceId}/NewDatabase/",
new { controller = "Server", action = "NewDatabase" }
);
routes.MapRoute(
"Instance",
"Server/{id}/Instances/{instanceId}/Databases",
new { controller = "Server", action = "Databases", id = "id",instanceId="instanceId" }
);
routes.MapRoute(
"Database",
"Server/{id}/Instances",
new { controller = "Server", action = "Instances", id = "id" }
);
如果xyz.com/Server/12/Instance/1/NewDatabase
將是reuested URL到服務器, Server/{serverId}/Instances/{instanceId}/NewDatabase/
將匹配模式。 我如何知道哪些條目符合上述要求?
感謝
有任何建造方法? – kbvishnu 2012-07-23 12:12:58
@VeeKeyBee。不是我知道如果。但只需要幾分鐘就可以完成上述操作。你有沒有理由不能? – 2012-07-23 12:16:21