473,406 Members | 2,710 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,406 software developers and data experts.

Application variable

I would like to know if there is any kind of difference between an empty web project and an web application project other
than all the files stucked toghether to the web application project. I am asking this because if i set an application
variable in the web application project and retrieve its value in another page(page.aspx) the application variable comes
with the vatue i set on the global.asax, but if a do the same on the empty web project, the variable comes empty
Basically what i do is adding the files a need, in this case global.asax and page.aspx. Do i need to set any kind of reference in the project to get this
working

Thanks in advance.
Nov 18 '05 #1
4 1771
in both cases how are you retrieving the variable set in the global asax
file. there should be no difference. The run-time behavior is not related to
the project include files unless the global asax file is not part of the
project.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Me_Titus" <an*******@discussions.microsoft.com> wrote in message
news:D9**********************************@microsof t.com...
I would like to know if there is any kind of difference between an empty web project and an web application project other than all the files stucked toghether to the web application project. I am asking this because if i set an application variable in the web application project and retrieve its value in another page(page.aspx) the application variable comes with the vatue i set on the global.asax, but if a do the same on the empty web project, the variable comes empty. Basically what i do is adding the files a need, in this case global.asax and page.aspx. Do i need to set any kind of reference in the project to get
this working?
Thanks in advance.

Nov 18 '05 #2
I am getting is value using the fallowing code

<CODE

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Loa

Me.TextBox5.Text = CStr(Session("v")

End Su

</CODE

This should be simple i just dont undertantd why its not working
The global.asax makes part of the project
Thanks
Nov 18 '05 #3
well that's not going to work. application variables are entirely different
from session variables to begin with. Session variables are per session,
application variables are always available during the life of the
application which isn't related to the session life.

the question is what access do you want. access to a variable which persists
even after you close the browser (application variable) or access to a
variable which goes away once the session ends (session variable)?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Me_Titus" <an*******@discussions.microsoft.com> wrote in message
news:DA**********************************@microsof t.com...
I am getting is value using the fallowing code:

<CODE>

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TextBox5.Text = CStr(Session("v"))

End Sub

</CODE>

This should be simple i just dont undertantd why its not working.
The global.asax makes part of the project.
Thanks

Nov 18 '05 #4
I have the same problem. Have a look at my thread.. //Matti

http://www.thescripts.com/forum/thre...obal.asax.html
May 14 '06 #5

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

Similar topics

33
by: aa | last post by:
I am migrating to PHP from ASP where there are the Application Scope variables which are accessible from any page on a website and which are used, in particular, for hit counters. Is there a similar...
5
by: Mark Fisher | last post by:
I have a Java desktop GUI application that the user can run multiple times. In order to keep one instance of the application distinct from another, I'd like to put the instance number of the...
2
by: Duncan Welch | last post by:
Good morning, I have a classic ASP app that I'm converting to .NET. In the existing app when accessing infrequntly changed data, it reads a database once a day, and saves the results in an...
3
by: Patrick | last post by:
Hi I have the following problem. When starting my asp.net application, i read a encrypted string from a file, decrypt it and want this values to be available in the complete application. they...
4
by: Keith Chadwick | last post by:
I am having some trouble referencing an Application("myVar") variable from within a module.vb file on my ASP.NET site. According to the documentation I should be able to reference...
9
by: William LaMartin | last post by:
I have a problem, mentioned here before, of Session and Application variables disappearing at one site but not at others or on my development computer. The problem is illustrated by an example...
7
by: Greg Collins [MVP] | last post by:
Hi, I couldn't find what I was looking for by searching the newsgroup, but perhaps these have already been discussed somewhere. This is a bit long with a lot of interrelated questions. What I've...
20
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business...
2
by: Frank_00001 | last post by:
I've migrated an application from VS 2003 to VS 2005. It worked fine in 2003; but I've been having issue in 2005. The latest is dealing with a DataSet that I have as an Application Variable. It...
7
by: Victor | last post by:
I've got two domain names sharing the same IP address that use ASP VBScript If I set a session variable with domain 1, it is only available for domain 1 - this is correct? If I set an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.