473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

goofy global.asa

Hi all,
i have a problem with a website where i use asp 3 and a global.asa in the
root.
In global.asa i use some aaplication variables which contains strings, such
as: Application("str1")="text".
Sometimes (even if i dont change the code) application variables becomes
null
To solve the problem i delete from server my global.asa and upload new one
(with same code inside)
Provider says their servers are all right
how can i fix it?

Thanx

Nov 19 '05 #1
8 1560
"Giorgio" <da*@sa.it> wrote in message
news:pI*******************@news3.tin.it...
how can i fix it?


What did they tell you in the ASP newsgroup...?
Nov 19 '05 #2
> What did they tell you in the ASP newsgroup...?

which one?
i posted to an italian ng but i didn't get any answer
is there any other?
Nov 19 '05 #3
microsoft.public.inetserver.asp.general
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Giorgio" <da*@sa.it> wrote in message news:8f*******************@news3.tin.it...
What did they tell you in the ASP newsgroup...?


which one?
i posted to an italian ng but i didn't get any answer
is there any other?

Nov 19 '05 #4
Are you setting this variable in the Application_OnStart event?

I suspect your application was restarted and that is why
you are losing the value. This event fires when the application
starts back up.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

"Giorgio" <da*@sa.it> wrote in message
news:pI*******************@news3.tin.it...
Hi all,
i have a problem with a website where i use asp 3 and a global.asa in the
root.
In global.asa i use some aaplication variables which contains strings,
such
as: Application("str1")="text".
Sometimes (even if i dont change the code) application variables becomes
null
To solve the problem i delete from server my global.asa and upload new
one
(with same code inside)
Provider says their servers are all right
how can i fix it?

Thanx

Nov 19 '05 #5
If your Application variables are "evaporating" occasionally,
you can reset them, and make sure they do exist, by using an include file:

Include this "test_app_vars.inc" in your pages :

<% language="vbscript" RUNAT=SERVER %>
<%
If Application("str1") = "" Then
'this runs f the variables have been lost
Application.Lock 'Lock App while you reset
Application("str1") = "whatever that variable is"
Application("str2") = "whatever"
Application("str3") = "something else"
Application.Unlock
End If
%>

That will assure you that even if the variables are "lost", by anything your
provider has misconfigured, your variables will be available for your use
in any page in which you include "test_app_vars.inc".


Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"Giorgio" <da*@sa.it> wrote in message news:pI*******************@news3.tin.it...
Hi all,
i have a problem with a website where i use asp 3 and a global.asa in the
root.
In global.asa i use some aaplication variables which contains strings, such
as: Application("str1")="text".
Sometimes (even if i dont change the code) application variables becomes
null
To solve the problem i delete from server my global.asa and upload new one
(with same code inside)
Provider says their servers are all right
how can i fix it?

Thanx

Nov 19 '05 #6
> That will assure you that even if the variables are "lost", by anything
your
provider has misconfigured, your variables will be available for your use
in any page in which you include "test_app_vars.inc".


Thanks (for the ng address also).
Doing so, i have to put the include in any page, so i could even not use
global.asa anymore, but include file only.

The strings are connection strings to several databases, so i use these
strings in a lot of pages and global.asa was so usefull cause in the pages i
don't have to write code
Nov 19 '05 #7
> Are you setting this variable in the Application_OnStart event?

I suspect your application was restarted and that is why
you are losing the value. This event fires when the application
starts back up.


Thanks.
Yes, i set them in that event.
Does not this event fire when any page is accessed first time by first
client?
So, also if it had been "resetted", when first client access a page the
string should be avalaible, isn't it?

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Option Explicit

Sub Application_OnStart
Application("str1") = "text"
End Sub

Sub Application_OnEnd
'end
End Sub

Sub Session_OnStart
'start
End Sub

Sub Session_OnEnd
'end
End Sub
</SCRIPT>
Nov 19 '05 #8

Hello! Is there a better seller of event tickets than ticketmaster?
I really need this info..Thanks :)
--
JessicaL
------------------------------------------------------------------------
JessicaL's Profile: http://www.hightechtalks.com/m642
View this thread: http://www.hightechtalks.com/t79266

Jan 29 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: David Hitillambeau | last post by:
Hi guys, As I am new to Python, i was wondering how to declare and use global variables. Suppose i have the following structure in the same module (same file): def foo: <instructions>...
4
by: Jozef | last post by:
Hello, I have forms in my database that use grey as the back color. When I convert them to XP, They all look goofy. The grey becomes two tone. The grey used in the controls are dark, the grey...
3
by: clintonG | last post by:
What's with this software? Every day its a new surprise with some goofy bullsh!t. I finally make time to try to finish building out Membership logging and reporting and today its user data in the...
66
by: mensanator | last post by:
Probably just me. I've only been using Access and SQL Server for 12 years, so I'm sure my opinions don't count for anything. I was, nevertheless, looking forward to Sqlite3. And now that gmpy...
9
by: CDMAPoster | last post by:
About a year ago there was a thread about the use of global variables in A97: http://groups.google.com/group/comp.databases.ms-access/browse_frm/thread/fedc837a5aeb6157 Best Practices by Kang...
8
by: Rob T | last post by:
When I was using VS2003, I was able to compile my asp.net project locally on my machine and copy it to the production server and it would run just fine. I've now converted to VS2005. The project...
0
by: =?Utf-8?B?VHJhY2tz?= | last post by:
Does the toolstripcontainer etc work at all? I want to save the settings for the toolstrip positions in my app so they start up with the saved positions. Tried using: ...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
4
by: Hillbilly | last post by:
Maybe this is or isn't some kind of bug but it sure is goofy and remains a mystery that really has me puzzled for two reasons... // goofy syntax functions as expected... Panel finalStepButton =...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.