Comprehensive, categorized, searchable collection of links to ASP & ASP.NET resources...
ASP.NET Directory

Applications
Assembly & Controls
Books & Media
Community
Other ASP.NET Sites
Reference Material
Software & Server
Tutorials & Code
Web Site Hosts

ASP Directory

Applications
ASP.NET Directory
Books & Media
Community
Components
Other ASP Sites
Reference Material
Software & Server
Tutorials & Code
Web Site Hosts

Newsgroups

Participate in over
100 ASP & ASP.NET related newsgroups right here @ Fuzzy Software...

.NET Framework
- .net.faqs
- .net.framework
- .net.general
- .net.setup
- .net.scripting
- .net.xml

Web Services
- aspnet.webservices
- msdn.soaptoolkit
- msdn.webservices

SQL Server
- sqlserver.setup
- sqlserver.prog...
- sqlserver.tools

Classic ASP
- asp.db
- asp.general
- asp.components

Scripting
- scripting.jscript
- scripting.remote
- scripting.vbscript
- scripting.wsh

All newsgroups...

ASP Built-in
Objects Reference


Application Object
ObjectContext Object
Request Object
Response Object
Server Object
Session Object

Personalise Fuzzy
Make Homepage
Link To Fuzzy
Bookmark This Page

Add our directory to your site in less than
2 minutes...



InstantKB.NET - Complete ASP.NET Knowledge Base Management Solution








Whats New!
The CreateObject method creates an instance of a server component. If the component has implemented the OnStartPage and OnEndPage methods, the OnStartPage method is called at this time.

Syntax

Server.CreateObject( progID )
 

Parameters

progID
Specifies the type of object to create. The format for progID is [Vendor.]Component[.Version].

Remarks

By default, objects created by the Server.CreateObject method have page scope. This means that they are automatically destroyed by the server when it finishes processing the current ASP page.

To create an object with session or application scope, you can either use the <OBJECT> tag and set the SCOPE attribute to SESSION or APPLICATION, or store the object in a session or application variable.

For example, an object stored in a session variable, as shown in the following script, is destroyed when the Session object is destroyed. That is, when the session times out, or the Abandon method is called.

<% Set Session("ad") = Server.CreateObject("MSWC.AdRotator")%>
 

You can also destroy the 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 instance with the same name as a built-in object. For example, the following returns an error.

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

Example

<% Set MyAd = Server.CreateObject("MSWC.AdRotator") %> 
 

The preceding example creates a server component, MyAd, as a MSWC.AdRotator component that can be used to automate rotation of advertisements on a Web page.

Applies To

Server Object






$10/mo & 3 Months FREE!


Receive all the latest quality ASP
& ASP.NET content direct to your inbox. Sign-up to our newsletter.






DevDirect.com - Tools and Components for Software Developers

SurfHighway.com

DevBuilder.org

Bipin Joshi

More partners...

.net CART ASP.NET Shopping Cart and Ecommerce Solution for .NET
  9969 ASP & ASP.NET resources in over 483 categories and growing daily...
Fuzzy Software - asp / asp.net resources, tutorials, code, scripts, applications, components, newsgroups, hosts and much more... Sitemap 0 1 4