0

I have a Web-Forms application, deployed onto Azure.

The original application makes use of Web Methods in code behind in aspx files and ashx handlers. ASP.Net generates Javascript references for Post requests to these methods. I needed to maintain the Javascript, but wanted to implement WebApi controllers.

This works in my development environment, using IIS Express in Visual Studio.

I have added the required nuget packages for WebApi, and a series of Web Api Controllers. I created a Global.asax and configured the default WebApi routing, however each Web Api method, has its own Routing attribute to override the applicable method (ie.

[Route("[pagename].aspx/[methodName]")]

In dev this works. But when deployed to Azure App Service the original aspx file is still being called.

Am I missing something in my Configuration? I did try ..

runAllManagedModulesForAllRequests="true"

...but that did nothing.

2
  • Are you able to call the WebAPI method say from Postman. Also, while deploying did you check the box for deleting existing files that are not used anymore?
    – R Jain
    Commented Sep 20, 2019 at 14:56
  • Could you please tell me how you enable the web api route in asp.net web form? By using System.Web.Routing library? If possible, please post some related codes with your route config and global.asax for us to reproduce your issue. Commented Sep 23, 2019 at 7:08

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.