I would like to use WebAPI for an existing project of mine (classic ASP.NET), but as far as I can tell you can only use WebAPI with MVC.
Is it possible to use WebAPI with ASP.NET?
2 Answers 2
From the linked page:
Although ASP.NET Web API is packaged with ASP.NET MVC, it is easy to add Web API to a traditional ASP.NET Web Forms application. This tutorial walks you through the steps.
To use Web API in a Web Forms application, there are two main steps:
Add a Web API controller that derives from the ApiController class. Add a route table to the Application_Start method. Create a Web Forms Project
Start Visual Studio 2010 and select New Project from the Start page. Or, from the File menu, select New and then Project.
In the Templates pane, select Installed Templates and expand the Visual C# node. Under Visual C#, select Web. In the list of project templates, select ASP.NET Web Application. Enter a name for the project and click OK.
ASP.NET Web API and ASP.NET MVC live in two different worlds albeit parallel worlds.
Web API has been designed and built with no dependency to ASP.NET MVC but has been built on the top of ASP.NET.
So the answer to your question - with confidence - is true. Brad Wilson himself mentioned this on a podcast recently.