[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] Adding an Aplpication in ASP GUI or Global ASA file



> Hi all,
> 
> 	Anyone ever used the add an application utility in the 
> chiliASP GUI? I am
> needing to know how to use it properly please. From what I 
> understand it is
> similar to a global.asa file for ASP in that it allows you to 
> use global
> variables, which is what I am requiring specifically. So any help for
> someone with ASP knowledge but a newbie to global variables 
> (especially on a
> Cobalt RAQ) would greatly be appreciated.


Todd,

The following is taken fronm the chillisoft ASP help pages!

--start paste--
An ASP application is synonymous with a directory structure.
It represents a collection of files (URLs) and virtual directories
that are intended to work together to create a Web-based application.
An application starts the first time the Web server receives a
request for an ASP page in that application directory. It ends
when the Web server is shut down. You can create global data for
an application using the built-in ASP Application object.
Variables and object instances can be assigned to application
variables so they are available to all pages of an application.
--end paste--

For example if you want to define global variables for database
connectivity in the global.asa, you can use the Application_OnStart
or Session_OnStart event using the syntax
Application("variablename")= "somedata".

Put these in your global.asa file which should be in the root
of the application directory, the Application_Onstart event
only runs once, any variables defined here are fixed for all
users sessions. The Session_OnStart event runs everytime a
new user connects to your application, any variables set here
will be lost when that users session ends.

--Sample global.asa file--

<SCRIPT LANGUAGE=VBScript RUNAT=Server>

Sub Application_OnStart
 Application("App_ConnectionString") = "Provider=SQLOLEDB.1; etc"
 Application("App_ConnectionTimeout") = 15
 Application("App_CommandTimeout") = 30
 Application("App_CursorLocation") = 3
 Application("App_RuntimeUserName") = "guser"
End Sub

Sub Session_OnStart
 Session.Timeout=10
 Response.Expires=1
 Server.ScriptTimeout=60
 Application("User_SessionID") = Session.SessionID
End Sub

</SCRIPT>

--End Sample global.asa file--

Hope this helps

--
Clive