- I have a website using webforms, need to migrate to asp.net core 5, how it can be done. we are using webforms.aspx with JavaScript which calls our BL then BAL calls DAL .DAL is in entityfromwork 5.
- how long support of webforms will be there? Do we have to change from scratch?
yours sincerley
Abhishek YadavPosted Feb 8, 2024, 12:15 PM
Currently, ASP.NET Core officially supports WebForms through the Microsoft.AspNetCore.WebForms package. This package allows you to run existing WebForms applications on ASP.NET Core without rewriting them.
However, it's worth noting that ASP.NET Core is designed to encourage modern development practices and patterns, such as using the MVC pattern, Razor views, and the latest features of C#. If you are migrating from WebForms to ASP.NET Core, it is recommended to gradually refactor your codebase to leverage these modern practices.
To migrate your WebForms application to ASP.NET Core, you will have to follow a few steps:
1. Update your project to target ASP.NET Core 5. You can create a new ASP.NET Core project and manually migrate your code, or use the conversion tool provided by Microsoft called the "ASP.NET Core Upgrade Assistant" to automate the process.
2. Replace the WebForms-specific code, such as `` tags, with the equivalent Razor views and components. This may involve rewriting your UI code to use newer HTML and CSS standards.
3. Replace the JavaScript code that interacts with your WebForms controls with modern client-side frameworks like React or Angular.
4. Refactor your business logic to use the new ASP.NET Core patterns, such as controllers and services.
Regarding the support for WebForms, it is worth noting that Microsoft has committed to supporting WebForms indefinitely. However, they are not actively investing in new features or enhancements. The focus of ASP.NET development is now on ASP.NET Core, which follows a different development model.
In summary, migrating a WebForms application to ASP.NET Core involves a significant effort, but it can be done with the support of the Microsoft.AspNetCore.WebForms package. It is recommended to gradually refactor your codebase to leverage the modern patterns and features of ASP.NET Core.