|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
Tag Specific Options
Use the Tag Specific Options dialog box to customize how the HTML designer formats markup for individual tags. You can set general formatting options for all tags by using the Format, HTML, Text Editor, Options Dialog Box.
The settings that you make in the Tag Specific Options dialog box are used when you do the following:
Drag controls from the Toolbox onto the page.
Use Microsoft IntelliSense functionality to create tags in Source view.
Generate markup by using a dialog box, such as the Insert Table Dialog Box.
Reformat the selection or document manually by using the Format Document or Format Selection command on the Edit menu.
Setting tag-specific options is useful, if you frequently use certain tags and want to customize how the tags are formatted in the editor. Per-tag formatting lets you set the following options for tags:
Closure; that is, not closed, self-terminated, or with a separate closing tag.
Tag-specific formatting rules that you specify can be overridden by the rule that the HTML editor will not change the rendering of tags. If a tag formatting rule would change the way a tag is rendered, the rule is ignored.
To access the Tag Specific Options dialog box
On the Tools menu, click Options.
The Options dialog box appears.
Select the Show all settings check box, if the development environment is set to Web Development Settings.
For more information, see Visual Studio Settings.
Expand the Text editor node, expand the HTML node, and then click Format.
Click Tag Specific Options.
The Tag Specific Options dialog box appears.
Outlining for HTML tags follows the same conventions as outlining code in the code editor.
Per-tag tag formatting works on a model wherein there are default settings for each tag that provide the base rules by which the tag is formatted. There are four categories of tags, as follows:
Client tags that do not support contents, such as br /.
Client tags that support contents, such as table or h1.
Server tags that do not support contents, such as asp:CheckBox.
Server tags that support contents, such as asp:Repeater.
For each tag, the values from the appropriate category in the preceding list are used, unless an override is specified for that tag. By default, some overrides are supplied based on the common usage of the tags.