The AfterAppInit event is executed after the application is initialized.
Use this event to override any global ASPRunnerPro variables. See the description area in the Event editor for the list of available global variables.
Note: It is not recommended to use this event to display anything on the web page. Doing so may break your application.
Applies to pages
Let's say you need to troubleshoot your application by displaying an executed SQL query at the top of the page.
One way to do so is to proceed to the include/appsettings.asp file and set the dDebug variable to true. Though it might be tedious to change this variable back and forth.
By using the AfterAppInit event, you can display the debug info by adding debug=true to the URL.
if Request.QueryString("debug")="true" then
Sample URL: categories_list.asp?debug=true.
Note: the Database connection is not yet open in this event. If you need to perform any database operations, open the database connection manually.
set dbConnection = server.CreateObject("ADODB.Connection")
dbConnection.ConnectionString = strConnection
dbConnection.Execute "insert into log (LastAcccessTime) values(now())"
dbConnection.Close : set dbConnection = Nothing
Note: in this event, you can also apply the Database API methods to interact with the database.
Recommended predefined actions and sample events:
•Send a simple email
•Display a message on the Web page
•Redirect to another page
•Restrict access to ASPRunnerPro application by IP address
•Query Designer tab
•About SQLQuery API