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 — global.asax

Declare and create new application and session variables using a declarative, tag-based syntax.

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

Parameters

id
A unique name to use when referencing the object in subsequent code.
Class Name
The class to create a new instance of.
Classic COM ProgID
The Classic COM component to create a new instance of.
Classic COM ClassID
The Classic COM component to create a new instance of.

Attributes

The <object> tag supports the following attributes:

ID Provides a unique identifier to use when declaring an object on the 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 down for a client to handle.
Scope Declares the scope at which the object is declared. “Pipeline” indicates that the object is available only to the HttpPipeline instance defined by the containing ASP+ application file. “Application” indicates that the object is populated into the HttpApplicationState collection. “Session” indicates that the object is populated into session state. If no scope is specified, scope defaults to “Pipeline”.
Class Identifies the object type to create a new instance of.
ProgID Identifies Classic COM component to create a new instance of.
ClassID Identifies Classic COM component to create a new instance of.

Remarks

When the ASP+ processor encounters a server-side object tag in an ASP+ application file, it generates a get/set property on the class, using the ID attribute of the tag as the property name. The get method is then configured to create an instance of the object on first use.

If the object tag’s scope attribute is set to either “Application” or “Session”, a reference to the object (or at least enough information to lazily create it the first time it is accessed) is added to the StaticObjects collection of the appropriate application or session object. The object is automatically added to the namespace of all .aspx pages within the application.

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

[To be supplied.]

See also

ASP+ Application File Syntax