Special Edition Using Microsoft® Visual Studio for Enterprise Development

Previous chapterNext chapterContents


- 15 -
Advanced Visual InterDev Concepts

by Azam A. Mirza

Learn about the Global.asa file that provides a starting point for all Visual InterDev web applications.
Learn about client-side components and how to use them to enhance your web site. Learn about using the Script Wizard to build client-side scripts. Gain an understanding of the differences between Java applets and ActiveX controls and how they are used in Visual InterDev when building web applications.
Learn about the database tools provided with Visual InterDev for enabling application building, using ODBC-compliant databases on the back end.
Explore the advanced features and inner details of the Data Form Wizard and the files it creates.
Gain an understanding of the complete and comprehensive solution Visual InterDev provides for web development, including support for team development, staging and publishing, and site diagramming.

In Chapter 14, "Developing Active Content with Visual InterDev," you learned about some of the basic features provided by Visual InterDev, and in Chapter 16, "Visual InterDev Design-Time Controls," you will learn about the ActiveX controls that can help you build database-aware web pages. Now you are ready to learn about some of the exciting advanced features provided by Visual InterDev. This chapter introduces you to developing client-side features into your web sites, using client-side components and scripting.

Visual InterDev is designed to be the development tool for building dynamic and powerful web sites. To accomplish this task, it leverages the power of relational database systems for storing, managing, and producing data to be displayed to users. Most of the world's client/server applications use a database on the back end to provide support for data storage and retrieval, and the dynamic web world is no different. Visual InterDev includes powerful database connectivity, management, and development tools for building database-aware web sites.

In this chapter, you learn about some of these advanced features in greater detail and learn how you can leverage the power of Visual InterDev to energize your web site development effort.

The Global.asa File

The Global.asa is a special file automatically generated by the Visual InterDev project wizards to hold global functions and variables for the web application. Global.asa is also the place where global event handlers for the application and a particular user session are placed. Listing 15.1 lists the bare-bones Global.asa file that is created initially by Visual InterDev. The Global.asa file is where the Application and Session object event handlers are stored.


TIP: The Global.asa file resides in the root directory of your web application on the web server.

Listing 15.1  The Global.asa File

<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
`You can add special event handlers in this file that will run
`automatically when special Active Server Pages events
`occur. To create these handlers, just create a subroutine with
`a name from the list below that corresponds to the event
`you want to use. For example, to create an event handler for
`Session_OnStart, you would put the following code into this
`file (without the comments):
`Sub Session_OnStart
`**Put your code here **
`End Sub
`EventName        Description
`Session_OnStart   Runs the first time a user runs any page in your application
`Session_OnEnd    Runs when a user's session times out or quits your application
`Application_OnStart  Runs once when the first page of your application is run 
                     `for the first time by any user
`Application_OnEnd  Runs once when the web server shuts down
</SCRIPT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnStart
   `==Visual InterDev Generated - DataConnection startspan==
`--Project Data Connection
   Session("DataConn_ConnectionString") = "DBQ=C:\ProgramFiles\DevStudio\MyProjects\IntraGAS\Data\ei3.mdb;DefaultDir=C:\Program Files\DevStudio\MyProjects\IntraGAS\Data;Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;"
   Session("DataConn_ConnectionTimeout") = 15
   Session("DataConn_CommandTimeout") = 30
   Session("DataConn_RuntimeUserName") = "admin"
   Session("DataConn_RuntimePassword") = ""
`==Visual InterDev Generated - DataConnection endspan==
End Sub
</SCRIPT>

The Global.asa file is executed whenever a web application is accessed for the first time and whenever the application ends. The application starts when the first user accesses the application and ends when the last user exits the application. Each individual user access is regarded as a separate session.


NOTE: The Global.asa file is not displayed to the user. It is a file that is executed on the server without any output being sent to the client browser.

The Global.asa file must be stored in the root directory of the application, and every application can have only one Global.asa file.

In addition, the Global.asa file is used to declare objects that have global scope within the application. Use the <OBJECT> tag to declare objects in the Global.asa file. The syntax for using the <OBJECT> tag in the Global.asa file is

<OBJECT RUNAT=Server SCOPE=Scope ID=Identifier{PROGID="progID"|CLASSID="ClassID"}>

Listing 15.2 provides an example of an object declaration in the Global.asa file.

Listing 15.2  Using Application Object Variables to Store Information

<OBJECT RUNAT=Server SCOPE=Session ID=MyConn 
PROGID="ADODB.Connection">
</OBJECT>

The Global.asa file can also include scripts written in any supported scripting language. To include scripts in the Global.asa file, use the <SCRIPT> and </SCRIPT> tags. If you include script that is not enclosed by the script tags, the server generates an error.

Using Client-Side ActiveX Components

A powerful feature of dynamic web sites is their ability to incorporate client-side components. An example of client-side components is the use of Java applets or ActiveX controls to perform various tasks such as animations, scrolling marquees, and advertisements. Figure 15.1 illustrates a web site that uses ActiveX controls to provide highly powerful web-based application functionality.

FIG. 15.1
The Microsoft Investor web site uses client-side ActiveX controls to provide portfolio tracking functionality.

Visual InterDev supports two kinds of client-side components. These include

In addition, developers can also include scripts in their web pages that execute on the client side. Visual InterDev includes a powerful tool, the Script Wizard, for building client-side scripts.

There are multitudes of ways to use client-side components within your web applications. The following sections describe the ways these components can be incorporated to enhance your web applications.


ON THE WEB:You can download a large number of freeware and shareware ActiveX controls from a variety of web sites on the Internet. A good place to start is the Microsoft web site (www.microsoft.com) or a shareware web site such as the c|net's www.shareware.com.

ActiveX controls are compiled client-side components that perform specific tasks. To use ActiveX controls, your operating system and the client browser must support ActiveX controls. Currently, Microsoft Internet Explorer is the only major browser that supports ActiveX controls. In addition, ActiveX controls are supported on the Windows and Macintosh platforms with support for UNIX in the development stages.


NOTE: ActiveX controls are the result of the evolution of Microsoft OLE Custom Controls (OCXs) into web-aware objects that are streamlined for use across the Internet technologies.

As stated, ActiveX controls are compiled objects that are downloaded to the client machine for execution. For that reason, different versions of compiled ActiveX controls are required for various platforms. Their platform-specific nature enables ActiveX controls to take advantage of operating-system-specific features and capabilities. Most of the ActiveX controls available today are for the 32-bit Windows systems, Windows 95 and Windows NT. These controls can be developed in a variety of languages, such as Visual Basic, Visual C++, and Borland Delphi.


ON THE WEB:To build ActiveX controls for the Macintosh environment, you need to use the MetroWerks Code Warrior SDK, available for the Macintosh environment. For more information, visit www.metrowerks.com.


See Chapter 5, "Creating ActiveX Components with Visual Basic."
See Chapter 6, "Creating Components with Visual C++."

If you are familiar with Visual Basic Custom Controls (VBXs) or OLE Custom Controls (OCXs), you will have no problem adapting to ActiveX controls. Visual InterDev and FrontPage Editor both provide easy mechanisms for incorporating ActiveX controls in your web applications. Starting with Visual Studio 97, Visual Basic and Visual C++ are also capable of using ActiveX controls as part of traditional client/server applications.


TIP: Other development environments such as Delphi, PowerBuilder, and Lotus Notes also provide support for using ActiveX controls.

ActiveX Controls in HTML Pages

ActiveX controls can be incorporated into HTML pages by using the <OBJECT> tag. The script for the ActiveX control has to be enclosed within the <OBJECT> and </OBJECT> tags and can be scripted in either VBScript or JScript. Figure 15.2 illustrates the script used to insert a sample ActiveX control in an HTML page.

FIG. 15.2
ActiveX controls can be placed anywhere within an HTML page by using the <OBJECT> tag.


NOTE: ActiveX controls are different from Active Server Objects in that they include user interface elements.

The syntax of the object tag is as follows:

<OBJECT>
ID=identifier
ALIGN=LEFT|CENTER|RIGHT
BORDER=n
CLASSID=url
CODEBASE=url
CODETYPE=codetype
DATA=url
DECLARE
HEIGHT=n
HSPACE=n
NAME=url
SHAPES
STANDBY=message
TYPE=type
USEMAP=url
VSPACE=n
WIDTH=n>

In addition, you can define and set property settings for ActiveX controls by using the <PARAM> tags within the <OBJECT> and </OBJECT> tags.

The syntax for the <PARAM> tag is as follows:

<PARAM NAME=propertyname VALUE=value>

You can define as many <PARAM> tags as necessary within the <OBJECT> tags to initialize values for properties. Most properties are optional, however, and do not need to be set in the web page.

Visual InterDev also provides built-in tools that automate and simplify the process of inserting ActiveX controls into web pages. To insert an ActiveX control into a web page, open a project in Visual InterDev that includes an HTML file and then complete the following steps:

1. Open the HTML file in the Visual InterDev editor by double-clicking the file in the File View Explorer, as shown in Figure 15.3.

FIG. 15.3
The File View Explorer provides a tree-style view of the files in your current Visual InterDev project.

2. Place the mouse pointer at the location where you want to insert the ActiveX control in the HTML file, and right-click to show the shortcut menu seen in Figure 15.4.

FIG. 15.4
The shortcut menu provides access to the most commonly used Visual InterDev commands.

3. Choose Insert ActiveX Control from the shortcut menu.

4. Choose the control to insert from the list of ActiveX controls displayed in the Insert ActiveX Control dialog box.

5. Click OK to insert the control and display its image in the Properties dialog box, as shown in Figure 15.5.

FIG. 15.5
The Properties dialog box enables you to set values for the ActiveX control properties.

6. After you have set the properties the way you want, close the Properties dialog box and size the control the way you want. Then close the control page.

7. The HTML for the control is written into the HTML page automatically, as shown in Figure 15.6.

FIG. 15.6
The ActiveX Insert tool automates the process of adding the <OBJECT> tags to the HTML page for the ActiveX control.


TIP: Using the Visual InterDev ActiveX control insertion and editing tool is a lot easier than writing the <OBJECT> tag script into the HTML page.


NOTE: The FrontPage 97 Editor provides a similar tool for inserting and editing ActiveX controls in HTML files.

ActiveX Controls in ASP Pages

Using ActiveX controls in ASP pages is identical to using them in HTML pages; however, ASP provides a powerful mechanism for dynamically setting the properties of a client-side ActiveX control at runtime. By using server-side scripting, you can dynamically set property values for ActiveX controls; for example, you can set the values of a listbox by getting the values from a database table. The job is accomplished by using <%=varname%> or a similar expression within the appropriate <PARAM> tags for the ActiveX control in the ASP page. Listing 15.3 illustrates the method.

Listing 15.3  Dynamic Setting of Client-Side ActiveX Controls

<% dim lblCaption 
lblCaption = "User Name:"
%>
<OBJECT ID="Label1" WIDTH=132 HEIGHT=24
 CLASSID="CLSID:978C9E23-D4B0-11CE-BF2D-00AA003F40D0">
  <PARAM NAME="Caption" VALUE=<%=lblCaption%>>
  <PARAM NAME="Size" VALUE="3493;635">
  <PARAM NAME="FontCharSet" VALUE="0">
  <PARAM NAME="FontPitchAndFamily" VALUE="2">
</OBJECT>

The CLASSID is a special parameter that is used to uniquely identify the ActiveX control. Every ActiveX control must have a uniquely generated CLASSID. If you recompile or re-create your ActiveX control, a new CLASSID will be generated. At that point, you must update the CLASSID in your HTML code with the new CLASSID.

The Script Wizard

The Script Wizard is a tool included with both Visual InterDev and the FrontPage 97 Editor. The Script Wizard makes it possible to program handlers for events, methods, and properties for ActiveX controls. It also provides support for building client-side VBScript or JScript code.


TIP: The ActiveX Control Pad also includes the Script Wizard. It is a separate product that can be downloaded from the Microsoft web site (www.microsoft.com).


NOTE: The Script Wizard is used to generate client-side scripts only. It cannot generate server-side scripts.

ActiveX controls generate events when executed. You can write VBScript or JScript code to handle these events and provide functionality for performing various tasks in response to the generated events. In addition, the Script Wizard provides access to the browser events, methods, and properties to give you control over the client browser.


TIP: You can easily change the default scripting language for the Script Wizard by choosing Tools, Options in Visual InterDev. The Options dialog HTML tab shows options for changing the default Script Wizard language between VBScript and JScript.

Now you will see how to use the Script Wizard and learn about its capabilities. Open an HTML page in the Visual InterDev source editor and insert an ActiveX button control, using the methods defined earlier in the "ActiveX Controls in HTML Pages" section. Follow these steps to add code for handling the Click event for the command button on the HTML page:

1. Open the HTML file in the Visual InterDev source editor and right-click anywhere in the file to display the shortcut menu. Choose Script Wizard from the menu options.

2. The Script Wizard dialog box is displayed, as shown in Figure 15.7.

FIG. 15.7
The Script Wizard provides an Explorer-style interface for adding event handlers and methods to ActiveX controls.


NOTE: The Script Wizard is smart enough to recognize the presence of the ActiveX control on the page and, accordingly, displays the events and properties for that control.
3. Expand the command button event tree by clicking the plus sign next to the command button name in the left pane.

4. Select the Click event in the left pane. Make sure the Code View option button at the bottom of the dialog box is selected.

5. Type in the VBScript code displayed in the bottom window of the dialog box, as shown in Figure 15.8.

FIG. 15.8
The Code View window provides full support for scripting in the default scripting language.

6. Click OK to close the Script Wizard dialog box. The procedure you just entered is displayed in the HTML page, as shown in Figure 15.9.

FIG. 15.9
The Script Wizard adds the client-side procedures in the HTML page, close to the control they are written for.

7. Display the HTML page in a browser by choosing the Preview feature of Visual InterDev from the shortcut menu.

8. With the page displayed, use the View Source option of the browser to display the source behind the HTML page. You should see the CommandButton1_Click event handler as part of the HTML page, as shown in Figure 15.10.

FIG. 15.10
The View Source feature of Internet Explorer allows you to view the source being used to generate the HTML page.

One of the important features of the Script Wizard is its capability to expose the events, properties, and methods associated with an ActiveX control. This powerful feature comes in handy when you are trying to figure out the functionality provided by an ActiveX control.


TIP: The Script Wizard is similar in its capability to the Visual Basic Object Browser for exposing control properties, events, and methods.

Java Applets

Java applets are programs that can be integrated into HTML pages to provide a variety of functions, including animations, applications, sound, graphics, and audio. Java applets are actual applications written in the Java language, which can be programmed to perform any task imaginable.


See Chapter 7, "Creating Components with Visual J++."


ON THE WEB:Thousands of Java applets are available as shareware on the Internet. You can use any of these applets as part of your Visual InterDev applications. For more information, visit www.javaworld.com.

Database Development Tools

Visual InterDev provides strong support for building applications that rely on relational databases to provide interactivity and dynamic content. For that reason, Visual InterDev provides tools and features not only for developing database-enabled web applications, but also for managing back-end databases.

Visual InterDev database features include


See Chapter 16, "Visual InterDev Design-Time Controls."

The tools for core database management and development functionality provided by Visual InterDev are referred to as the Microsoft Visual Database Tools. The Visual Database Tools are not exclusive to Visual InterDev and are shared across other Visual Studio development tools, such as Visual C++ Enterprise Edition and Visual Basic Enterprise Edition. The database tools within Visual Studio, however, are based on ODBC connectivity to the database, and you must have ODBC-compliant drivers available for the database you are trying to use, such as Microsoft SQL Server, Microsoft Access, or Oracle databases. The Visual Development tools include

The following sections discuss these features of the Visual Database Tools in more detail, including a discussion of database connectivity using ODBC.

Using ODBC Data Sources

An ODBC data source defines how an application connects to a back-end database. Visual InterDev includes support for the ODBC 3.0 database connectivity tools. ODBC services are provided by a driver supplied by the database manufacturer or a third-party vendor. ODBC provides connectivity for both client/server databases, such as SQL Server, and shared file databases, such as Microsoft Access.


NOTE: Visual InterDev includes ODBC drivers for Microsoft Access, FoxPro, SQL Server, and Oracle. Other database drivers are available through third-party developers.

The ODBC driver provides a logical software connection to the database and uses a defined data source to determine the location of the database, how to connect to it, the login information, and the parameters common to all query operations.

ODBC 3.0 supports two kinds of database connections. These include

Both methods provide the same functionality; however, Registry-based DSNs are machine-specific, whereas file-based DSNs can be shared across multiple machines. The file DSNs provide a very useful method for sharing DSNs across an enterprise by saving the DSN files on a shared network drive.

It is possible to create ODBC DSNs through the Visual InterDev development environment; however, it is important to remember that both the web server and the Visual InterDev development workstation need an ODBC DSN to connect to the database. The web server needs the DSN to provide runtime access to the database while users are browsing the web site. The development workstation needs the DSN for connectivity to the database during development and testing.


TIP: It is a good idea to use file DSNs and store them on a shared directory on the web server to provide access to these file DSNs from the development workstations.

To set up a shared ODBC file DSN on the web server, take the following steps:

1. Log on to the web server and start the ODBC Administrator utility from the Control Panel.

2. Choose the File DSN tab and click Add to start the New Data Source Wizard.

3. From the list of database drivers, choose the driver for which you want to create the DSN and click Next.

4. Provide a name for the data source and then click Next. Make sure that you provide a full UNC path (\\servername\sharename\dsnname) to the DSN file location on a shared drive on the web server.


NOTE: A UNC (Universal Naming Convention) path refers to a network location using the server name and directory tree, for example, \\MyServer\MyDirectory\MySubDirectory.
5. Click the Finish button to close the New Data Source Wizard.

6. If the DSN you have set up requires additional information, a dialog box is displayed, as shown in Figure 15.11.

FIG. 15.11
The SQL Server Login dialog box is displayed to obtain login information for the DSN.

7. Provide the login information and click OK to return to the ODBC Administrator utility.

8. Click OK to close the ODBC Administrator utility.

Now that you have added an ODBC DSN, you can use that DSN to add database connections within your Visual InterDev projects. To add a database connection to a project, take the following steps:

1. Open the project in Visual InterDev and right-click the project name to display the shortcut menu. Choose Add Data Connection to display the Select Data Source dialog box.

2. Choose the file DSN you created previously. If necessary, a login dialog box is displayed for the database being accessed, as shown in Figure 15.12.

FIG. 15.12
Provide a valid login for the database and choose the database name from the list.

3. Click OK to continue. A database connection is added to the project, as shown in the File View in Figure 15.13.

FIG. 15.13
The database connection allows access to all the tables, queries, and views within the database.

After you have set up a connection to a database within your project, you can use the various Visual Database Tools to manage the database, build queries, and perform tasks required for doing database application development.

The Integrated Data View

The Integrated Data View is used to provide a live view into the ODBC data sources being used in a web application. The Data View is a powerful tool with which you can manage ODBC databases, including support for adding, deleting, and updating of database tables and records. Figure 15.14 illustrates the Data View within the Visual InterDev IDE.

FIG. 15.14
The Data View uses the familiar Explorer-style IDE to provide access to database objects and properties.

The Data View lists the database tables, views, and stored procedures defined within the database. You can view, edit, add, update, or delete anything from this view into the database. The Data View is fairly similar to the SQL Server Enterprise Manager in its capabilities and user interface.

Figure 15.15 illustrates the various views that can be obtained into the database and the data stored in the tables. Double-click a table to display in the right pane the data stored in that table. Use the pop-up database utilities toolbar to toggle between views.


TIP: Right-click any object in the Data View Explorer to get to the Properties menu to display the properties of the object.

The Database Designer

The Database Designer brings visual ease of use and flexibility to creating and managing remote SQL Server 6.5 databases. The Database Designer is integrated into the Data View and provides the following two key elements for creating and managing SQL Server 6.5 databases:

FIG. 15.15
The Data View displays multiple panes: the Diagram pane, the Grid pane, the SQL pane, and the Results pane.

The Advanced Query Designer

The Advanced Query Designer is a familiar tool that has its roots in the old Microsoft Query and the query designer built into Microsoft Access. If you have used either of these tools, you will feel right at home with the Advanced Query Designer. Figure 15.16 illustrates the Advanced Query Designer.

FIG. 15.16
The Advanced Query Designer works with any ODBC-compliant database.

To use the Advanced Query Designer to create queries, take the following steps:

1. Double-click a table in the Data View Explorer to open the table in the right pane.

2. Click the Diagram pane, the Grid pane, and the SQL pane to display the various data views from the Query toolbar.

3. Select any other tables you want to use in the query and drag them to the Diagram pane.

4. Select columns to include in the query by clicking the checkbox next to the column name. As you select the columns, notice that the Grid and SQL panes update to reflect the changes.

5. Click the Run (!) button in the Query toolbar to run your query and display the data in the Results pane.

6. When you have finished, close the Advanced Query Designer. When you are asked to save the query, provide an appropriate name and location and save the query. You can now use the query in your application.

Exploring the Data Form Wizard

The Data Form Wizard is a powerful tool for creating database-aware web pages. It provides an advanced set of features for creating list- and form-based pages for displaying data to users. Web pages created with the Data Form Wizard can be used to view, edit, add, update, or delete information from tables in an ODBC database.

The Data Form Wizard has an Advanced Options dialog box in which you can control the appearance and behavior of the data being displayed. Figure 15.17 shows the Advanced Options dialog box for the Data Form Wizard.

To set advanced options, follow these steps:

1. Select the field name in the Field Name listbox.

2. Enter the new field label in the Alternative Field Label box. The alternative label is used instead of the default label generated by Visual InterDev if it is specified.

3. If the field is based on a lookup table, select the lookup table in the Look-up Table drop-down box.

4. Select the ID field from the Corresponding Key ID drop-down box and the Display field from the Display This Field drop-down box.

FIG. 15.17
The Advanced Options dialog box is used to specify field and label properties.

5. Repeat the procedure for all pertinent fields in the Field Name listbox.

6. Click OK to close the Advanced Options dialog box.


TIP: A lookup table enables the selection of a field, the contents of which will be used to populate a drop-down listbox. Users will then be limited to selecting only from the options available in the drop-down listbox.

The Data Form Wizard generates three .ASP files, complete with source code and design-time control references. The filenames of these files are based on a table-name-based prefix and a wizard-assigned suffix. The suffixes generated by the wizard are List.asp, Form.asp, and Action.asp. The files generated include


NOTE: The two design-time controls used are the Data Range Header control and the Data Range Footer control.


For more information about design-time ActiveX controls, see Chapter 16, "Visual InterDev Design-Time Controls."

FIG. 15.18
The List View can be used to page through multiple records in a grid format.

FIG. 15.19
The Form View provides buttons for Update, Delete, New, Filter, and List View.

Each of the three generated files includes variable and procedure declarations for the file, along with a large number of HTML formatting codes for displaying the page appropriately in the web browser.

The List.asp file includes the following procedures:

In addition to the preceding items, the Form.asp file includes the following procedure:

The Action.asp file includes the following procedures:

In addition to the procedures described in the preceding lists, the Data Form Wizard generates a lot of supporting script. It generates scripts for creating the database connection and for checking the recordset status and code for handling lookup table functionality.

The Data Form Wizard generates files complete with script code and design-time ActiveX controls. If the code generated by the Data Form Wizard requires any modifications, you must make them manually.


For more information about utilizing the ActiveX design-time controls, see Chapter 16, "Visual InterDev Design-Time Controls."

Managing Visual InterDev Projects

A great deal of functionality is provided by Visual InterDev and its associated tools and utilities for building powerful web applications. In addition, Visual InterDev includes a set of utilities to provide ancillary functions, such as support for team development, staging and publishing of web sites, working on multiple projects, and other project management issues. The following sections discuss these functions in further detail.

Team Development

Visual InterDev provides strong support for team development through Visual SourceSafe. Visual SourceSafe is integrated into the Visual Studio 97 IDE and provides source management for the products included in Visual Studio 97.


For more information about using Visual SourceSafe, see Chapter 26, "Using Visual SourceSafe."

SourceSafe provides source management, version control, and file check-in and check-out capabilities that work seamlessly within Visual InterDev to manage large team-development efforts. Visual SourceSafe works with any type of file, including text files, HTML files, and binary image and graphics files.

Visual SourceSafe integration for web projects is server-based. The web server administrator needs to install a copy of Visual SourceSafe on the server. No Visual SourceSafe components need to be installed on Development workstations.


TIP: Because Visual SourceSafe works on the server, the file check-in and check-out operations work over HTTP. They can work across firewalls and proxy servers and can span the Internet.

Developers can install client versions of Visual SourceSafe on their workstations to take advantage of other source-management capabilities, such as File Compare and File Merge.

To use Visual SourceSafe with Visual InterDev, take the following steps:

1. Install Visual SourceSafe on the machine running the web server. Make sure the Enable Integration option is activated during setup of Visual SourceSafe.

2. Configure the user database on SourceSafe to provide access for two special user types: the Anonymous Internet account for the web server and the user IDs for web developers who need access to the source control system.

3. Start Visual InterDev and open the project for which you want to enable source control.

4. Choose Project, Enable Web Source Control.

5. Provide the name of the source control database to use with the project.

6. Click OK to continue.

Staging and Publishing Web Sites

The File View Explorer within Visual InterDev is a powerful tool that not only provides a view into the contents of a web site, but also enables you to create, delete, rename, and move files and folders. The support for drag and drop makes it very easy to move files between folders and projects.

Because a single workspace can contain multiple projects in the File View Explorer, you can easily move files between distinct remote web servers. This allows you to host multiple versions of a web site on different servers and move back and forth between them easily, with simple drag and drop.

For example, you can have two projects open within a single workspace that connects to two different servers. One server can be the staging server, where you do most of your development and testing of web sites. The other server can be the production server, where users connect to browse the web site. By using drag and drop, you can easily move content from the staging server to the production server and publish your web site to the user community. Figure 15.20 shows a workspace with two web projects in one space, where developers can move content back and forth.

FIG. 15.20
The File View Explorer allows drag-and-drop publishing of a web site.

Link Repair and Link View

The ease of use Visual InterDev affords in terms of file manipulation automates many aspects of web site management, so you can move files and folders with ease. However, when files are moved from one folder to another, the HTTP links within these files might no longer work.

Visual InterDev includes a Link Repair option that automatically repairs links to elements within a web site as files are moved. By default, this option is turned off in Visual InterDev. You can turn on the option by right-clicking the project in the File View and choosing Properties. In the Properties dialog box, activate Link Repair by clicking On.


CAUTION: Be careful with Link Repair. While parsing the files to repair links, Visual InterDev might mess up the spacing of text in HTML files, making them difficult to read in the Visual InterDev source editor.

Visual InterDev also includes a great tool for managing a web site. Called the Link View, this tool provides a graphic representation of a web site. Link View can work on any web site, providing a graphic representation of all the pages within the web site and the links between them. Figure 15.21 illustrates the Link View produced for the G. A. Sullivan web site.

FIG. 15.21
Link View is a great tool for troubleshooting broken links within a web site.

To use Link View, take the following steps:

1. Choose Tools, View Links on WWW.

2. In the View Links on WWW dialog box, provide the URL for the site you are trying to map, as shown in Figure 15.22.

FIG. 15.22
The URL can be of any web site accessible from the machine on which Link View is running.

3. The root page is displayed in the middle, surrounded by pages the root page provides a link to.

4. To display the links for any page, right-click on the page and choose View Links from the shortcut menu.

The arrows shown between the objects in a site are color-coded to indicate the status of the link. The link colors are based on the following scheme:

A view of the links to and from an object can be displayed by clicking the object. This method provides a quick view of all the links to and from a particular web page. To zoom the Link View in and out, choose View, Zoom or use the Zoom listbox on the Link View toolbar.

From Here...

In this chapter, you learned about some of the advanced features and functionality of Visual InterDev. You learned about using client-side components and scripting, the Visual Database Tools supplied with Visual InterDev, and project management facilities.

Refer to the following chapters for information related to building web sites and web-based applications using Visual InterDev:


Previous chapterNext chapterContents


© Copyright, Macmillan Computer Publishing. All rights reserved.