ASP 101 - Active Server Pages 101 - Web06
The Place ASP Developers Go!



Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash



 Top ASP 101 Stories Top ASP 101 Stories
Connections, Commands, And Procedures
What is ASP?
VBScript Classes: Part 1 of N

QUICK TIP:
Utilize browser capabilities
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates


Quick Tips


(<OBJECT> vs. Server.CreateObject())

When creating a server object using a server component, you have a choice between two methods. The most common method is to use the CreateObject() method of the Server object, as shown in the following code: SET NextLink = Server.CreateObject("MSWC.NextLink"). While this method works fine, there is another way to create an object that is just a bit more resource friendly.

When you create an object using the Server.CreateObject() method, the object is created as soon as the method is called. Any threads, memory, or other resources are allocated at the point of instantiation, or creation. The syntax for creating an object using the <OBJECT> tag is shown in the following statement:

<OBJECT Runat="Server" ID="NextLink" ProgID="MSWC.NextLink"></OBJECT>

By using the HTML <OBJECT> tag with the Runat=Server attribute, you can create the object in a way that it is not actually created until the first method or property of the new object is referenced. While this may not seem like a lot of savings, when you are trying to design a system that can withstand 1,000,000 hits per day, every little bit helps.


Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to: webmaster@asp101.com.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers