asp tutorials, asp.net tutorials, sample code, and Microsoft news from 15Seconds
Data Access  |   Troubleshooting  |   Security  |   Performance  |   ADSI  |   Upload  |   Email  |   Control Building  |   Component Building  |   Forms  |   XML  |   Web Services  |   ASP.NET  |   .NET Features  |   .NET 2.0  |   App Development  |   App Architecture  |   IIS  |   Wireless
 
Pioneering Active Server
 Power Search










Active News
15 Seconds Weekly Newsletter
• Complete Coverage
• Site Updates
• Upcoming Features

More Free Newsletters
Reference
News
Articles
Code Samples
Components
Tools
FAQ
Feedback
Books
Links
DL Archives
Community
Messageboard
List Servers
Mailing List
WebHosts
Consultants
Tech Jobs
15 Seconds
Home
Site Map
Press
Legal
Privacy Policy
internet.commerce














internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

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

HardwareCentral
Compare products, prices, and stores at Hardware Central!

PreviousNext

 

email this FAQ to a colleague

Q: Is there a way to create functions in seperate files, and have one active server script call the functions?

A: Not that I've found, no, and this is one of the most obvious gaps in ASP 3.0 from a software development point of view.

There are only two ways to manage code sharing under ASP; include files, and server-side components. Include files work like this: you dump your shared functions in an .INC file, and use an inline include to pull it into your source file of choice:

<!--#INCLUDE FILE="foo.inc"-->

Server-side components are well-discussed in the ASP documentation; you write your own ActiveX object (using Java, C++, Basic or COBOL), use Server.CreateObject() to instantiate it, and manipulate its properties and call its methods like you would (say) the Ad Rotator or an ADO RecordSet.

AFAIK, there are no way to call functions in other objects from one object. If anyone finds a way, please tell me. Include files are unwieldy and difficult to protect, and deploying new revisions of server-side components requires stopping and restarting the web server. Shared script functions would be an extremely useful half-way point.

- Garth T Kidd

Articles
Jun 6, 2002 - Client Side Validation Using the XMLHTTPRequest Object
Jonathan Zufi shows how to use the XMLHTTP object within JavaScript or VBScript to validate form-field information without having to submit a page and wait for the result.
[Read This Article]  [Top]
Nov 6, 2001 - Writing Your Own Script File to Migrate a Database
Learn how to write a script file using SQL Server's Bulk Copy Program for easy and speedy database migration.
[Read This Article]  [Top]
Sep 5, 2001 - Firing Events in a Shared Hosting Environment
Firing events on a Web server is an easy task. However most of the easy solutions require you to have your own dedicated IIS or SQL Server on the Internet to play with, a privilege not shared by many. In this article, Matthew Muller shows you how to get the same functionality in a shared hosting environment.
[Read This Article]  [Top]
Jun 26, 2001 - Dynamically Changing Static Web Galleries
Web galleries are an easy way to add interactivity and content to your Web site. However, how do you keep the Web galleries consistent with your site and how do you overcome the deficiencies of your Web gallery creation tool? John Sorensen explains a simple way to do both.
[Read This Article]  [Top]
Jun 8, 2001 - Implementing Dynamic Arrays of Objects
Using classes in ASP 3.0 we can create dynamic arrays of objects. Donnell DeLeon Smith's article also shows how we can implement a class of dynamic arrays of objects several layers deep, if required.
[Read This Article]  [Top]

Related Topics
ASP 1.0
Active Components

Knowledge Base Articles
ACC: Reading, Storing, & Writing Binary Large O...
Q103257 - 1997.07.10


Support the Active Server Industry



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers