Skip to main content


Creates an object instance.




General Attributes

Attribute Description Value
CLASSNAME The class name of the object. A valid class name.
NAME The name of the local variable used to refer to the object. A valid local variable name.
OBJID Object Identifier value used to open the object. A string.


The CSP:OBJECT tag places a Caché object on a page. Specifically, it ensures that a local variable, whose name is specified by the NAME attribute, contains a reference to an instance of the class specified by the CLASSNAME attribute. If the OBJID attribute has a non-null value, then the object instance is created by calling the %OpenId method using the value of the OBJID attribute. The object is closed when the server finishes serving the page.

Typically the CSP:OBJECT tag is used to create an object instance whose properties can be bound to the elements of an HTML form using the CSP BIND mechanism.

For example, the following creates an instance of the Sample.Person class and then binds its Name and SSN properties to HTML input fields:

<!-- Open Person Object with ID of 1 -->
<CSP:OBJECT NAME="person" CLASSNAME="Sample.Person" OBJID="1">

<!-- Define an HTML form and bind it to the object -->
<FORM NAME="MyForm" CSPBIND="person">
Name: <INPUT NAME="Name" CSPBIND="Name"><BR>

Refer to the Building Database Applications chapter in Using Caché Server Pages (CSP) for more information.

FeedbackOpens in a new tab