1

I have ASP MVC 3 application. I created WCF REST JSON Service and added it to my application by next code in Global.asax file in RegisterRoutes method:

    routes.Add("Api", new ServiceRoute("api", new WebServiceHostFactory(), typeof     (ExternalApiService)));

Service worked well, but when I tried to use

    RedirectToAction("Index", "User", new { id = 1 });

method in my controller action, it redirects to (http://localhost:8091/api?action=Index&controller=User&id=1) url.

Can anyone helps me on this issue?

tereško
  • 58,060
  • 25
  • 98
  • 150
O. V.
  • 125
  • 1
  • 8

1 Answers1

1

I think you might be missing routing constraints. Have a look at this discussion Routing with WCF ServiceRoute: Html.ActionLink rendering incorrect links!

Community
  • 1
  • 1
Yusubov
  • 5,815
  • 9
  • 32
  • 69