【发布时间】:2012-06-21 10:53:55
【问题描述】:
我有 ASP MVC 3 应用程序。我创建了 WCF REST JSON 服务,并通过 RegisterRoutes 方法中 Global.asax 文件中的下一个代码将其添加到我的应用程序中:
routes.Add("Api", new ServiceRoute("api", new WebServiceHostFactory(), typeof (ExternalApiService)));
服务很好,但是当我尝试使用时
RedirectToAction("Index", "User", new { id = 1 });
我的控制器操作中的方法,它重定向到 (http://localhost:8091/api?action=Index&controller=User&id=1) url。
谁能帮我解决这个问题?
【问题讨论】:
-
是的,我有带 id 参数的索引操作。
标签: c# asp.net-mvc asp.net-mvc-3 wcf asp.net-mvc-routing