The state of ASP.Net Web Forms in 2021

Maourice Gonzalez

Visual Studio 2022 Preview

Some background

The ASP.Net web forms framework launched nearly 20 years ago, and instead of asking developers to move on to the next shiny thing, Microsoft is still heavily investing in its proven web application framework. For those of you new to .NET and or perhaps not old enough to have ever experimented; ASP.NET web forms is a web application framework which allows developers to build “web forms” with server controls which can be reused making it very popular for building highly scalable and maintainable applications. It launched alongside .NET Framework 1.0 in 2002. It provided traditional windows application developers with familiar on-ramp to web development.

Some of the benefits over Classic ASP were faster performance due to the compiled nature of the code as well as improved quality as most errors would be caught at design time, not at run time. Some other benefits included a true object oriented model as well as the inherent ability to easily separate your presentation and business logic.

So before we jump into what is new, let’s talk about the elephant in the room. As of the writing of this article Microsoft has no plans to support Web Forms outside of .NET Framework. This means no .NET Core support. This however should not be an issue, as Microsoft has no plans to drop support for .NET Framework any time soon. With that said, its always a good idea to target the latest possible version of the framework for your projects to ensure your applications don’t fall behind in support.

New Designer and Live Data Preview

With Visual Studio 2022 Preview 2 come some much welcomed improvements to how you develop your Web Forms applications. There is a new Web Forms Designer waiting for you and your projects! When opening your .aspx files you will notice the new “design” and “split” buttons at the bottom of the screen. Changes made to the code will result in instant preview on the design pane as you’d expect.

ASP.NET Web Forms Designer

But it goes deeper than that; data bound to your controls like grids, etc. is now being loaded from the data source. No longer just showing you placeholders for these fields and for those that prefer building their apps from the design view; drag and drop support for controls is also available.

List of features included 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 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

These improvements show Microsoft’s commitment to supporting developers across their broad selection of tech stacks. In the past developers would be forced to move onto the next best thing or be stuck with stale tools. I am still a huge fan and proponent of Razor Pages and Blazor Server. However these investments ensure that decisions made many years ago continue to provide value for many years to come.

To try these new features out yourself, make sure you are running the latest version of Visual Studio 2022 Preview. If you haven’t already jumped on the 2020 Preview wagon, here is the link.

For an in-depth look at these features as well as information about some known issues present in this preview release, head over to Microsoft DevBlogs and check out the original blog post by Sayed Hashimi Senior Program Manager for Visual Studio.