Answer the question
In order to leave comments, you need to log in
How to configure request routing to ApiController in WebForms?
There is a legacy web application in WebForms (NOT MVC!)
It was necessary to attach an api (WebApiController web service) to it with requests like:
{url}/{api}/{action}
Created a web service inherited from ApiController
public class JobController : ApiController
{
// GET api/<controller>
public IEnumerable Get()
{
return "Hello, world!";
}
}
RouteTable.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{action}/{params}",
defaults: new { controller = "Job", action = "get" }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question