How It Works

Before you can use any feature (such as a DTC) that depends upon the Scripting Object Model, you must enable the SOM. If you try to insert an object in a page that requires the Scripting Object Model but have not yet enabled the SOM, Visual InterDev will warn you that you need to enable the SOM first and will prompt you to enable it.

You can directly enable the Scripting Object Model with these steps:

  1. Display the properties for the ASP Web page by right-clicking the page and selecting Properties from the context menu.
  2. Check the Enable Scripting Object Model check box under ASP Settings.

This will add the SOM code to your page, enabling you to use DTCs and other features that require the Scripting Object Model. This process is illustrated in Figure 4-1, which shows the Enable Scripting Object Model check box checked and the Apply button clicked. At the top of the page, the following code has been inserted:

 <%@ Language=VBScript %> <% ' VI 6.0 Scripting Object Model Enabled %> <!--#include file="_ScriptLibrary/pm.asp"--> <% if StartPageProcessing() Then Response.End() %> <FORM name=thisForm METHOD=post> 

This code will be inserted at the end of the file:

<% ' VI 6.0 Scripting Object Model Enabled %> <% EndPageProcessing() %> </FORM> 

click to view at full size.

Figure 4-1. The Properties dialog box for an ASP Web page allows you to enable the SOM.

These two sections of code do several things. First, the pm.asp file is included in the project. This file contains numerous functions that will be called by DTCs and possibly by your code. Next, the StartPageProcessing function is called to initiate the SOM for this page. Then, an HTML form named thisForm is created. The form is used by DTCs and other objects as well as your own code. Lastly, the code at the end of the page executes the EndPageProcessing function and terminates thisForm.

The run-time properties of the Scripting Object Model do not appear in the Properties window. These properties and methods are available in the Microsoft IntelliSense statement completion features of Visual InterDev 6.



Programming Microsoft Visual InterDev 6. 0
Programming Microsoft Visual InterDev 6.0
ISBN: 1572318147
EAN: 2147483647
Year: 2005
Pages: 143

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net