In detail
WebForms to Blazor Migration

In 2019, the axe falls
At the .NET Conf 2019 conference, Microsoft officially confirmed that WebForms would not be ported to .NET Core. Although its lifespan remains tied to that of .NET Framework 4.8, which in turn is linked to the lifespan of Windows, this sent a clear signal that it was time to invest in a new technology. At that point, I had developed an e-commerce website, closely integrated with an ERP and based on WebForms.
Choosing Blazor
In the autumn of 2020, the decision was made to use Blazor. I saw it as a « natural » successor to WebForms: it uses Razor components that combine HTML and C# code (logic), much like the old .aspx and .aspx.cs files. At the time, it was Microsoft’s very latest web technology. Yet there was a definite sense that we were venturing into something new, even revolutionary, that was still far from widely adopted.
A complete change of mindset
In practice, it took some time to adopt the right principles behind Blazor development. The way an application is broken down is very different: the developer needs to think in terms of « components » rather than « pages ». The smaller the component, the easier it is to develop, test and reuse.
It also means almost completely abandoning the idea that « anything that happens in the browser must be done in JavaScript ». Blazor provides a highly efficient mechanism for sending the necessary changes to the web page displayed in the user’s browser, driven by code (C#) running on the server. Goodbye Ajax, farewell JavaScript!
An ultimately smooth migration
In the end, the major change concerned the « scenery », the HTML page, with the main challenge being the rewriting of the user interface. The rest could be migrated quite easily from the old WebForms code. The website calls the ERP’s business engines (creating an order, adding an item, validating an order): no changes were required there. Likewise, all the SQL queries and the syntax surrounding them remained unchanged.
The result
The result is impressive: a website that behaves like a « single-page application », with no more postback refreshes. And the development team works almost exclusively with what it knows best: C#. The door is wide open to further developments, both technological and functional.
This migration shows that a major technological change does not necessarily mean starting again from scratch. By retaining the application’s business engines and proven foundations while rebuilding its interface with modern technology, it was possible to evolve the product significantly without abandoning its history. WebForms gave way to Blazor, but the essentials remained: the business logic, C# and years of code that continued to retain all their value.
