This topic is locked
[SOLVED]

 custom functions script

10/22/2010 7:15:10 PM
ASPRunnerPro General questions
W
waynes888 author

Is there a way to add a custom functions script that loads before the page loads. What I need is my own common function script to load just after the dal & aspr common functions have been loaded in DBCommon. I know I can edit an add to the source file but the problem with this is you need to remember all the source edits so when you next upgrade you don't overwrite them all. I also know you can add it to the header but then events can't use custom functions, which is where I want to use them, because the events run before header is loaded. Therefore the only logical place is in dbcommon right after all the file includes.
Would be nice if there was a "before application initialized" event to be able to add custom functions.

Sergey Kornilov admin 10/23/2010
W
waynes888 author 10/23/2010



There is an article for that:

http://xlinesoft.com/asprunnerpro/docs/how_to_add_external_files.htm


Thx Sergey. The problem with includincluding scripts in events is that I can't share the code for all events which is what I am trying to do. In that example I would have to include the same file for every table. My common functions are used throughout all the events so by the time the event loader or even after application initialised event, it's too late for my own common functions. I need a hook before the events are called so that I can add my own shared functions that all the events can use. So I guess a genric "before events loaded event" that applies to all tables is what I am after....

Sergey Kornilov admin 10/23/2010

I'm afraid you are misreading the manual. If you put include file to AfterAppInitialized event it will be accessible everywhere.

W
waynes888 author 10/24/2010



I'm afraid you are misreading the manual. If you put include file to AfterAppInitialized event it will be accessible everywhere.



thx Sergey, I did try that first and the syntax check throws an error for "<%" so I assumed it didn't work. I tried it now and it seems to work regardless of the syntax error.....