What's New in the Web Page Designer and Editors
Microsoft Visual Studio 2005 includes improvements over previous versions of Visual Studio in Web page designer features for editing ASP.NET pages, user controls, HTML pages, cascading style sheets, configuration files, and other documents.
General
This section describes general enhancements and changes that have been made to the Web page designer and other editors.
New Tab Names
The Web page designer now offers two tabs:
-
Design view, which includes a number of enhancements from previous versions of Visual Studio.
-
Source view, which is the replacement for HTML view that was used in previous versions of Visual Studio.
Enhancements to both views are described later in this topic.
Adding Controls
In the Web page designer, you can drag controls from the Toolbox in both Design view and Source view.
Formatting Preservation
The Web page designer preserves your formatting when you switch between Design view and Source view. The document is no longer reformatted each time you switch views. If you edit elements in Design view, the editor performs the minimal reformatting required to reflect the change.
Note |
|---|
| If the Web page designer cannot switch from Source view to Design view because of syntax errors or other problems that would require reformatting content, the designer displays an error and blocks the switch. |
XHTML Pages
By default, when you create a new Web page in Visual Studio, the page includes skeleton markup that conforms to XHTML standards. Content that is generated by the HTML editor also conforms to XHTML standards. For details, see XHTML in Visual Web Developer.
Navigation
In the Web page designer, Document Outline displays the current element, along with the hierarchy of parent tags to which it belongs. You can use Document Outline to determine which element has the focus and to move between elements. In addition, in Source view, the tag navigator displays the current tag in its immediate context, enabling you to navigate or select the tags. For details, see HTML Editor Tag Navigation in Visual Web Developer.
Working in Design View
The changes described in this section are new for working in Design view in the Web page designer.
Layout
The Web page designer now assumes flow-based layout in vsprvslong. The FlowLayout and GridLayout elements that were used in previous versions of Visual Studio are no longer in the Toolbox. Instead, you can establish absolute positioning for individual controls. For details, see Positioning Elements in Design View.
In Design view, the positioning grid is now always invisible. However, you can still snap elements to the grid. For details, see CSS Positioning, HTML Designer, Options Dialog Box.
The commands for inserting and editing new HTML tables are improved. For details, see What's New in HTML Table Editing in Visual Studio.
Smart Tags
In Design view, ASP.NET server controls display a Smart Tag menu that offers quick access to the settings and actions that are used most often to configure the control. By default, the Smart Tag menu is displayed when you first drag a control onto the page from the Toolbox. You can display and hide the Smart Tag menu at any time.
Working in Source View and Text Editors
The changes discussed in this section are new for working in text-editing mode for Web pages and other types of Web files. This includes Source view in the Web page designer.
Validation
All Web page designer source editors, including Source view for Web pages, automatically check the syntax in the document, and then mark tags, attributes, and values that are not valid. Validation covers almost all types of markup, including HTML, server controls, and page directives. Validation can also check that references to external resources such as image files are valid.
You can select a validation schema to work with either by browser (for example, Internet Explorer 6.0) or by standard (for example, XHTML 1.1). For details, see Markup Validation in Visual Web Developer.
Markup errors are displayed in a number of ways:
-
Marked with squiggly lines, which is similar to the way a word processor, such as Microsoft Word, marks errors.
-
As a ToolTip, which provides details about each error.
-
In the Error List window, which displays details about each error.
IntelliSense
In Source view of the Web page designer, the editor displays Microsoft IntelliSense technology for virtually all elements, including ASP.NET server controls, markup, page directives, cascading style sheet and in-line styles, and client script. Because the IntelliSense technology that is offered by the editor is controlled by the current validation schema, the editor does not present IntelliSense technology for tags, attributes, and values that are not valid for the current schema.
The IntelliSense technology is also available for editing in the following files:
-
Configuration.
-
.css for creating style definitions.
-
Server-side code.
-
Client script in script elements.
Formatting
In the Web page designer, Source view offers a full set of options for formatting the document and individual tags:
-
Dragging or pasting elements.
When you drag elements from the Toolbox or paste them from the Clipboard, the editor can either create them exactly as they were formatted before or it can reformat them according to options that you specify. For details, see Miscellaneous, HTML, Text Editor, Options Dialog Box.
-
Matching tags.
When you select an opening or closing tag, the editor highlights the matching tag to make it easier for you to identify blocks.
-
Adding quotation marks or closing tags.
You can set options that cause the editor to insert quotation marks around attribute values and create an end tag when you finish a start tag. For details, see Format, HTML, Text Editor, Options Dialog Box.
-
Formatting per tag.
You can specify rules for how the editor formats tags as you create elements. Options include how to capitalize tags and attributes, colorization, and where to put line breaks. For details, see Tag Specific Options.
-
Formatting elements or documents.
You can apply the current formatting rules to a selected section or the entire document.
-
Outlining tags.
You can collapse and expand elements to create more working space in the editor. For example, you can collapse a table element to hide its rows and cells, and then expand it when you want to edit it. You can collapse and expand elements manually, and you can specify rules for how large an element is before the editor automatically applies outlining to an element.
Note Outlining is available in other editors as well, such as the code editor. For general information about outlining, seeOutlining (Managed Package Framework).