Visual Studio 2022 received a minor but important update to its oldest ASP.NET framework, Web Forms. A new feature, Web Live Preview, was added which allows developers to see live data preview of their coding. This is a welcome update to an older framework and one that many will see as a positive quality of life update.
As one developer noted, there are many companies still relying on old Web Form applications that do not have the budget to rewrite in another language/platform.
Developers can access Web Live Preview by doing the following:
Once the Web Live Preview extension is installed, a new option “Edit in Browser” will be available when right-clicking an ASPX page within Visual Studio. Your default browser will then launch with the selected ASPX page in a special mode. In this mode, any elements selected on the app will be synchronised with your source. Changes made to your source code will reflect in the app displayed in the browser without manual refreshing.
New features in Web Live Preview
In Visual Studio 2022 Preview 2, Microsoft also introduced a new Web Forms project designer, powered by Web Live Preview.
This allows developers to see a live preview within the designer as a full page view, or in a split view. It supports the latest browsers and allows live data previews, instead of “placeholder” data. Other updates include the ability to drag and drop a control from the toolbox onto the design surface and being able to edit text directly in the design view.
Here is the list of features being supported in the new designer:
- Full support for latest browser technology
- Preview using live data instead of “placeholder” data
- Selecting a control in the designer will navigate to the source
- Live updates when changes are made to asp.net view files
- Live updates when changes are made to CSS files
- Drag and drop from the toolbox into design view
- Change text in the designer view
- Action Panel (aka Smart Tag) support for controls that have support for it
- Double click control to add default event handler
- Ability to use design/preview features in the browser
Looking for a .NET specialist?