Using Javascript in Global.asa?

Results 1 to 2 of 2

Thread: Using Javascript in Global.asa?

  1. #1
    Join Date
    Dec 1969

    Default Using Javascript in Global.asa?

    HI, the company that I work for has developed an asp site consisting of well over 100 pages. They've recently received a complaint that the client wants to be alerted when the session times out. I know of the javascript method but I was wondering if there was a way to do this without having to insert the javascript into every page. or including the file in every page. For instance: inserting the javascript code into the global.asa. Is this possible so the javascript code can be inserted in that one file and work for every page? Or do I have to make sure that each page reads the javascript individually? Thanks for any feedback and help.

  2. #2
    Join Date
    Dec 1969

    Default You can't do it the way you want to

    but there are ways to do it.<BR><BR>First off... global.asa is by no means supposed to interact with the browser, it for IIS and IIS only (read SERVER side)<BR><BR>Javascript is client side.<BR><BR>I realize it may be a pain to modify all the pages but it may be necessary unless you know of a page or two that are already included (&#060;!-- include statement --&#062;) which you could modify to suit your needs.<BR><BR>The technique I have in mind is this, I&#039;m not going to write the code, just a few ideas you could use:<BR><BR>On the beginning of each page, store the Session.Timeout in an ASP variable which you will "plug" in a javascript function.<BR><BR>The goal is to build a textfield, or div/layer if you can that javascript will decrease as time goes.<BR><BR>A countdown that you could place somewhere in your page.<BR><BR>So your client could see how much time he&#039;s got before his sessio gets deleted.<BR><BR>OR<BR><BR>you can simply start a javascript timer so that in say 30 minutes, pop a message saying : "you&#039;re out"<BR><BR>Don&#039;t work with server technologies if the goal you are trying to reach is for client side.<BR><BR>Take the info you need from the server (Session.Timeout) and that&#039;s all javascript needs to know to get going.<BR><BR>(I&#039;m not sure the proper name is Session.Timeout, you might wanna verofy that)<BR><BR>Eniac<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts