Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combine classic ASP.NET and ASP.NET MVC within one web application

We currently have a classic ASP.NET web application which serves as our API. It basically has a bunch of ASMX Web Services, but these are really cumbersome to work with from JavaScript. What I want is to expose a set of RESTful endpoints, but doing this in classis ASP.NET is not what I really want to do.

I'm considering to combine both classic ASP.NET and ASP.NET MVC in one web app. Is this possible at all? If yes, what are the issues/problems I may encounter?

like image 754
Anton Gogolev Avatar asked Oct 19 '09 10:10

Anton Gogolev


People also ask

Is it possible to combine asp net webforms and ASP MVC and develop a single Web application?

Luckily, the answer is yes. Combining ASP.NET Webforms and ASP.NET MVC in one application is possible—in fact, it is quite easy. The reason for this is that the ASP.NET MVC framework has been built on top of ASP.NET.

Can MVC and ASP.NET coexist?

MVC is just a different implementation of the IHttpHandler interface so both classic ASP.NET and ASP.NET MVC pages can coexist in the same app. Show activity on this post. As you've probably noticed with the above answers, yes this is very possible to do.

Is ASP.NET and ASP.NET MVC same?

The main difference between ASP.NET Core and ASP.NET MVC 5 is their cross-platform approach. ASP.NET Core can be used on Windows, Mac, or Linux, whereas ASP.NET MVC 5 can only be used for applications on Windows. The ASP.NET Core MVC is a framework for building web apps and APIs, optimized for use with ASP.NET Core.

Are MVC and Web API merged into one in mvc6?

ASP.NET MVC 6 comes with some new features as well. Some prominent ones are: - MVC, WEB API and Web Pages are merged into one single framework. - Project.


2 Answers

Aha! It seems that this is very much possible. Here's a comprehensive article which describes what should be done.

like image 91
Anton Gogolev Avatar answered Oct 04 '22 18:10

Anton Gogolev


An ASP.NET Webforms application can become ASP.NET MVC enabled by following some simple steps,its quite easy infact see this link if you want to go rest for mvc heres a article Rest for mvc by Phil Haack and Rest like nature of MVC heres a comparison Rest in asp net vs wcf

like image 22
almog.ori Avatar answered Oct 04 '22 19:10

almog.ori