How would I run both of them under one main website, say www.example.com, which is written and deployed using a Visual Studio ASP.Net MVC web application project, and where an ASP.Net Web Forms website, would run from a subdirectory of the main site, say www.example.com/myapp?
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.
If you add a plain ASPX page to an ASP.NET MVC project, well, it just works like a charm without any changes to the configuration. If you invoke the ASPX page, the ASPX page is processed with viewstate and postbacks.
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. 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.
The following steps help you use the Syncfusion Project Conversion in the existing ASP.NET MVC Project. Open an existing Microsoft MVC Project or create a new Microsoft MVC Project. Right-click on Project and select Syncfusion VS Extensions and choose the Convert to Syncfusion MVC (Web) Application.
See Hanselman's blog post. The basic idea is that you add a regular WebForm to your MVC project, then tell the routing engine to ignore that path when doing MVC routing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With