Monday, May 13, 2013

ASP.NET 4.5 Features - Key HTML Editor Features

With release of ASP.NET 4.5, we have seen many new enhancement in HTML.Today, we would be go through HTML key editor features introduced in ASP.NET 4.5.
Below are the most important / productive enhancement introduced in HTML with ASP.NET 4.5

a) Smart Tasks
b) Extract to User Control
c) HTML5 Snippets
d) Automatic Renaming of matching tag
e) Event Handler Generation

Automatic Renaming of the matching tag

In ASP.NET 4.5, we have very productive feature where matching tag is automatically renamed when we change the opening tag.
Consider the below code in HTML side

Now in earlier version of ASP.NET if i have to make a change in the starting tag then i had to manually update the end tag too. However, with ASP.NET 4.5, you would see that if you update starting tag, then end tag would also update automatically.
Please see below image for more details.

Extract to User Control
ASP.NET 4.5 has come up with very unique and productive feature where at any point of time, we can change code present in web form to user control.
Consider i have a web form containing textbox for userName and Password for authentication. While working on this page, we found that we need this user name and password authentication in different modules of the project.

With this said, ASP.NET 4.5 provides us the greate feature where we have to simply select the code and we can change that selected code to User Control

Smart Task in HTML Editor
One of the productive feature added in ASP.NET few years back was addition of smart task. On the click of the smart available on the control, you can accomplish some of the common task on that control.

Now with ASP.NET 4.5, we have same feature while working on HTML side. Hence, we don't have to go to design mode to use this feature.

If you click on the line present under 'a' , this would open up the smart task for that control.

You can see that you can perform all the common task for that control

Code Snippets in HTML
With ASP.NET 4.5, we have code snippets available in HTML.
If you want to add Audio or video on you page, you simply have to type video on HTML and press TAB twice. You will see that full audio / video control is available with you, mentioning all the common properties

Event Handler generation

Before the release of ASP.NET 4.5, if we have to create any event handler for any control, we either have to double click on that control, which will generate an event for that control or define the even in the properties of that control. However, with ASP.NET 4.56 we have new property added in the control, where we can generate an event for control at HTML side and we don't have to switch to design mode.

Clicking on 'Create New Event' would create default event for that control;however we can give any name of that event and you would see that Visual Studio will then automatically generate the appropriate server side event handler within your code behind file for you.

Hope this article of mine has been helpful in giving some knowledge new features of ASP.NET 4.5. To read more such articles visit my blog -

No comments:

Post a Comment