473,320 Members | 1,887 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,320 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 1767
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.