NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Server-side Object Tags

Server-side object tags declare and instantiate Classic COM and NGWS objects using a declarative, tag-based syntax.

<object id=”id” runat=server class=”NGWS Class Name”>
<object id=”id” runat=server progid=”Classic COM ProgID”/>
<object id=”id” runat=server classid=”Classic COM ClassID”/>

Parameters

id
Unique name to use when referencing the object in subsequent code.
NGWS Class Name
Identifies the NGWS class to instantiate.
Classic COM ProgID
Identifies Classic COM component to instantiate.
Classic COM ClassID
Identifies Classic COM component to instantiate.

Attributes

The object tag supports the following attributes:

ID Unique identifier to use when declaring object on page.
Runat Must be set to “server” for the object to execute within ASP+. All non-server values cause the page compiler to assume that the object tag should be transmitted to the client.
Class Identifies NGWS class to instantiate.
ProgID Identifies Classic COM component to instantiate.
ClassID Identifies Classic COM component to instantiate.

Remarks

When the page parser/compiler encounters a server-side object tag in an ASP+ file, it generates a get/set property on the page, using the ID attribute of the tag as the property name. The get (accessor) method is then configured to create an instance of the object on first use. The resulting instance is not added as an object within the page’s hierarchical server control tree; it is instead treated as a non-UI variable declaration.

The classid, progid, and class attributes are mutually exclusive. It is an error to use more than one of these attributes within a single server-side object tag.

Example

<html>
   <object id=”MyDatabase” class=”Microsoft.WFC.XDO.OLEDBAdaptor” runat=”server”/>
   <script language=”VB” runat=server>
      Sub Page_Load(Sender as Object, E as EventArgs)
         Dim StockDetails as Recordset
         Set StockDetails = MyDatabase.Execute(“DSN:money”, “select * from stocks”)
      End Sub
   </script>
</html>

See also

ASP+ Page Syntax