locked
multiple functions with get request in web-api issue. RRS feed

  • Question

  • User-1720943447 posted

    Hello,

    i am new to asp.net web api-

    I am calling webapi methods from asp.net forms website.

    i need to call 2 different methods by ajax request.

    It is showing me "Multiple actions were found that match the request:" error

    I have made following settings in global.asax---

    void Application_Start(object sender, EventArgs e)
    {
    // Code that runs on application startup

    System.Web.Routing.RouteTable.Routes.MapHttpRoute(
    name: "DefaultApi",
    routeTemplate: "api/{controller}/{action}/{id}",
    defaults: new { id = System.Web.Http.RouteParameter.Optional }
    );
    System.Web.Routing.RouteTable.Routes.MapHttpRoute(
    name: "DefaultApi1",
    routeTemplate: "api/{controller}/{id}",
    defaults: new { id = System.Web.Http.RouteParameter.Optional }
    );
    }

    how to implement this.

    -satyajeet

    Friday, March 8, 2013 2:17 AM

Answers

All replies