Script writers often find that they need to accomplish certain tasks in their scripts on a regular basis. For example, you might have a number of scripts, all of which ultimately perform different tasks, but all of which need to get information from a user. Objects save you the labor of reinventing the wheel every time you need to perform such a common task. An object is a combination of programming and data that can be treated as a unit.
To use most objects, you must first create an instance of that object. (For more information about creating instances of objects, refer to Working with Components.) However, Active Server Pages (ASP) includes five objects that do not require instantiation. The following table summarizes these inline objects, the tasks you can use them to accomplish, and where to look for examples.
Use the | To | Find examples in |
---|---|---|
Request object | Get information from a user. | Getting Information from a User |
Response object | Send information to a user. | Sending Information to a User |
Server object | Perform utility tasks on your Web server. | Working with Components |
Session object | Store information about a user’s session. | Developing Active Server Pages Applications |
Application object | Share information among users of an application. | Developing Active Server Pages Applications |
Some objects contain collections. A collection is a set of related pieces of information that are accessed the same way.
You gain access to objects and collections from a script by way of methods and properties.
Note You can also access information in a collection using the For...Each procedure. Refer to Debugging Scripts for more information about this procedure.
Object.Method Variant Data String URL
Whether a method requires a variant, data, a string, or a URL depends on the method; refer to Object Reference for more information about a specific method.
A property is a named attribute of an object. Properties define object characteristics, such as size, color, and screen location; or the state of an object, such as enabled or disabled. The syntax is
Object.Property nMinutes NumSeconds StatusDescription date time ContentType flag
Whether a property requires a value, string, or flag depends on the property; refer to Object Reference for more information about a specific property.