
In the
previous article, you could learn about the innovations that are intended for web developers in
Visual Studio 2012 to work with HTML / CSS and JavaScript code. WebForms Editor also received support for all these innovations. In addition, new features have been added that are specific to editing WebForms.
This article will discuss some of the innovations in the WebForms editor, which make working with this framework more convenient and more efficient.
Smart Tasks in a text editor
From the very beginning, WebForms editor offered two ways to work with markup: through the code editor and through the visual page designer. For many reasons, most developers choose to work with markup through a regular code editor.
')
However, in the page designer there was one useful thing that allowed you to quickly generate code, link data to controls, and so on - this mechanism is called Smart Tasks. It was probably the only function that sometimes made sense to switch to the visual editor.
I am pleased to announce that in Visual Studio 2012, Smart Tasks support has been added to the text editor itself, so now you can forget about the visual designer forever (Figure 1).

Fig.1. SmartTasks in a WebForms text editor
Extract to user control
Another new useful feature of the WebForms editor in Visual Studio 2012 is the "Extract to User Control" function, which allows you to select a piece of code and turn it into an ASP.NET WebForms control with one command (Figure 2).


Fig. 2. Extract to User Control function
IntelliSense in server inserts
In Visual Studio 2012, the long-awaited IntelliSense support appeared in server code inserts for plain HTML. Previously, such support was only for code in server controls (Figure 3).

Fig.3. IntelliSense support in server boxes
Generating event handlers
Another useful addition to the WebForms editor was the support for generating event handlers for ASP.NET controls directly in the code editor (Figure 4).

Fig.4. Generating event handlers
In this case, the corresponding event handler method will be automatically generated in the corresponding codebehind file.
Conclusion
ASP.NET WebForms editor in
Visual Studio 2012 has received several useful innovations that will allow the developer to write the markup code of WebForms pages faster and more efficiently.
Smart Tasks support inside a text editor allows you to completely abandon the visual designer of ASP.NET pages and get access to the powerful code autogeneration function directly in a text editor.