Sun
ONE Active Server Pages Product Home Page Developer Site Version
 

ContentsPreviousNextIndex



Examples: ASP Server Object CreateObject Method

You can destroy an object by setting the variable to NOTHING or setting the variable to a new value, as shown below. The first example releases the object “ad.“ The second replaces “ad“ with a string:

<% Session("ad") = Nothing %> 
<% Session("ad") = "some other value" %> 

You cannot create an object with the same name as a built-in object. The following example will cause an error:

<% Set Response = Server.CreateObject("Response") %> 

The following example creates an instance of the MSWC.BrowserType component. This component can be used to determine the capabilities of the browser requesting the page.

<% Set MyB = Server.CreateObject("MSWC.BrowserType") %> 


ContentsPreviousNextIndex