Using a Script Library
page 1 of 1
Published: 13 Oct 2003
Unedited - Community Contributed
This article describes what a script library is and how to implement it on your pages.
by . .
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 11497/ 27

Using a Script Library

Use a Script Library


Published 1/25/01


If you have something that you do often, on many pages (like open a database connection, display changing content on your pages etc.) then you should use a script library.

Eg. Let us say that your using the XML News thing from this article and you want to show this on a few pages. Ok, you'll use an include wherever you want to use it. Lets say that you also have a DB connection that you use frequently and you've added some tweaks to the XML News code so you can change what it displays. Now you may want to consider a script library.


It's very simple, just create an ASP/ASP.NET page with a bunch of methods, like -

Sub writemessage(message as String)
Response.Write(message & " Printed by your Script Library."
End Sub

Sub openDB()
'Open DB
End Sub

Sub QueryDB(qstring as String)
'Check for Connection
'Run Query
End Sub

Then all you have to do is include it at the top of your ASP/ASP.NET file.

<!-- #include file="/scriptlib.asp" -->


User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2018  |  Page Processed at 2018-03-19 10:06:13 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search