Visual InterDev

Adding Components to a Page

See Also      Tasks

In addition to typing HTML text, you can add a variety of components to your page, including:

In general, you can add components to your page by dragging them from either the Toolbox or the Project Explorer.

Adding Controls and Objects

When you are working in Microsoft® Visual InterDev™, the Toolbox lists controls that you can use on your page. These include:

To use any of these components, drag them from the Toolbox onto your page at the location you want them to appear. Most controls and objects are displayed graphically in the HTML editor in both Design view and Source view. In Source view, you can specify that you want to see the text version of an object.

Note   You can customize the Toolbox by adding new elements and tabs. For details, see Toolbox.

Adding References to Files

When you add images, links, documents, and style sheets to your page, you don't actually embed the element in your page. Instead, you add a reference to that element. For example, when you add an image, you are adding an HTML <IMG> tag that includes the name of the .gif file containing the image.

You can add a referenced element to your page by dragging it from the Project Explorer. You can do this with:

You can drag elements onto the page from any drag source, including Windows® Explorer. When you do, the URL of the element is made relative to your project root.

Note   You might need to fix the URL of the link in Source view to be correct for your deployed project.

Adding Database Connectivity

If your Web pages interact with a database, you can easily create data commands in your Web project and data-bound controls on a page. Using drag and drop, you can:

For more information about data connectivity, see Database Basics and Data Access Architecture. For details about using data-bound controls, see Getting Records and Displaying Data on Your Web Page.

Storing and Reusing HTML Text

If you want to reuse any element in your page — HTML text, a control, a script, a link, or any other element that you can select — you can store it on the Toolbox. Select the text, and then drag it to the Toolbox. When you drop it, the Toolbox creates a new element called HTML Fragment. You can then drag the element from the Toolbox to any other page.

If you want to store multiple elements this way, you can give them meaningful names and even create a special tab in the Toolbox for them. For details, see Toolbox.