A few of my favorite new HTML source editor features in Visual Web Developer & VS 2005
page 4 of 9
by Scott Guthrie
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 28052/ 210

Intellisense for User Controls and Custom Controls (no special work required)

We now (automatically) support HTML editor based intellisense for any control or user-control used within the project.  For example, the below screen-shot shows the intellisense I get when consuming an .ascx user-control on a page that has a custom “Foo” property:

Figure 6

The new web project system will dynamically compile and use reflection to figure out what properties are exposed on the user-control.

Custom compiled controls no longer need to jump through schema registration hoops to get intellisense either.  Simply register the control using a standard <%@ Register %> directive at the top of the page, and VS will also use reflection to provide intellisense within the html editor.  (note: this was a real pain with VS 2003).

Tag-Navigator

At the bottom of an html or asp.net source-view document is a new control called the “tag-navigator”.  It updates as you move around a document, and always shows the complete parent chain of html tags from the root <html> element to the location where the cursor currently is.  If any of these tags has an ID value, it will also include that value as well (for example: div#myidvalue).

This makes it much easier to figure out “where am I in a document”, and figure out the nesting relationships of elements quickly (“am I in this div/table or a deeper nested one?”).  This can be super-useful with large html documents.

For example: here is a screenshot of what it looks like when I copy/pasted in some html from the my.yahoo.com website (which has a lot of html):

Figure 7

What is then cool is that when you click on any of the elements in the navigator it will highlight them (and optionally allow you to highlight the inner contents).

Collapse/Expand HTML

 

Container elements in HTML are now collapsible (and expandable) using +/- gestures in the left hand side of the editor.  For example, the GridView in the below screen-shot is collapsed to hide all of its inner content:

Figure 8

Note that you can have multiple levels of collapsing – so you could expand the above GridView to see more of its contents, but still have one of its templates inside collapsed.  Makes dealing with lots of content much cleaner.

HTML Tag Bolding

If you click on (or navigate onto) any element within the html editor, we will now bold both it and its end tag:

Figure 9

This also makes it much easier to navigate around deeply nested HTML documents and figure out where elements start and end.

Per Tag Formatting Rules

 

You can now specify and control precisely how your HTML will look when you add it to a page.  You can set both the defaults for capitalization rules, indentations, whitespace, etc for elements:

Figure 10

As well as customize default formatting settings on a per-element or control basis:

Figure 11

This will control what the html source will look like when you add it in the designer (for example: drag/drop from a toolbox). 

You can also then within the html source editor select any HTML you want, right-click, and choose to “Format Selection”.  This will modify the selected HTML to follow your coding guideline rules (very useful when you are given ugly HTML to use).

Per HTML Element/Control Colorization

Someone in the Beta1 timeframe told us that he absolutely loved the new HTML editor capabilities, and that the only feature he was missing that would prevent him from switching from HomeSite was the ability to perform per-tag colorization in the source editor.

Figure 12

Whoever you are out there – we hope you are happy now (it is supported in the final release, complete with a 32-bit color palate to choose from). ;-)


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2019 ASPAlliance.com  |  Page Processed at 2019-05-26 8:12:22 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search