Application variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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 said:
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
 
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
 
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 said:
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
 
Back
Top