473,668 Members | 2,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1786
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*******@disc ussions.microso ft.com> wrote in message
news:D9******** *************** ***********@mic rosoft.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.EventArg s) Handles MyBase.Loa

Me.TextBox5.Tex t = 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*******@disc ussions.microso ft.com> wrote in message
news:DA******** *************** ***********@mic rosoft.com...
I am getting is value using the fallowing code:

<CODE>

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
Me.TextBox5.Tex t = 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
mschvili
2 New Member
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
15875
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 mechanism in PHP?
5
3839
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 application in the title bar. For example, the user starts the application, and the title bar says "Control Panel". The user starts another instance of the application, and it knows that one instance is already running, so the title bar of the...
2
2718
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 application variable. I'm trying to replicate this in .NET, but I'm using a data access layer (DAL) that's in a seperate project. Obviously, the DAL can't see the application variables. I was thinking of passing the application state in the...
3
2511
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 should be stored in a global variable, but it shouldn't be possible to modify this variable. so what i tried first was using the application object to store that string. that was fine, but the problem is, that it can be modified from outside, so...
4
1655
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 System.Web.HttpApplication but it does not seem to like that one bit. I also have a MSXML2.DOMDocument30 defined as a public object within the vb module which is loaded during the application start up with a bunch of XML. What is weird is that the data contained...
9
2448
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 at http://www.lamartin.com/dotnet/sessiontestset.aspx, were I set Session, Application and Cache variables on the first page and then on the second page view them as the second page is refreshed every five seconds. Before 10 refreshes, the...
7
2162
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 got is a decodeImage.aspx page that gets called to decode base64 encoded images and return them as displayable images to a Web page. The ASPX page is passed two parameters, "file" and "img". The "file" parameter specifies and XML file on the Web...
20
4454
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 logic layer(so far so good and easy).I initialize my class which is using a FileSystemWatcher in my Global.asax and everything works fine.I have found FileSystemWatcher class not very reliable and sometimes it behavies unexpectedly.I'm afriad that...
2
1237
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 seems to disappear when the users session times out. What really weird is that it works fine on my development box; but flakes out on the server. I added a button to a dummy webpage to reload the Application variable; but it still disappears...
7
2231
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 application variable with domain 1, the app variable is sharing across all domains using that IP address - this is correct? This is the behavior I am seeing and I want to make sure that my server is set up correct. I especially want to make sure...
0
8889
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8790
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8570
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6206
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2781
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.