📜 ⬆️ ⬇️

Effective web development with Visual Studio 2012: innovations in the WebForms editor



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).

clip_image001
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).

clip_image002

clip_image003
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).

clip_image004
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).

clip_image005
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.

Source: https://habr.com/ru/post/145672/


All Articles