1
我有ASP MVC 3應用程序。我創建WCF REST JSON服務,並在Global.asax文件將它添加到我的申請明年代碼的RegisterRoutes方法:ASP MVC RedirectToAction當路由包含WebServiceHostFactory時重定向錯誤
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參數的索引操作。 –
沒有幫助,結果相同 –