473,387 Members | 1,669 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,387 software developers and data experts.

Can't reach variables from global.asax

I try to control the number of how many users are on the site at the moment. To do so I have use the global.asax like this:

Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
  2. <html>
  3. <head>
  4. <title>Untitled Document</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <script language="VB" runat="server">
  7. Sub Application_Start()
  8.   Application.Lock()
  9.   Application("datum")=Now()
  10.   Application("on")=0
  11.   Application("namn")="Spider-applikationen"
  12.   Application.UnLock()
  13. End Sub
  14. Sub Session_Start()
  15.   Application.Lock()
  16.   Application("on")=Application("on") + 1
  17.   Application.UnLock()
  18. End Sub
  19. Sub Session_End()
  20.   Application.Lock()
  21.   Application("on")=Application("on") - 1
  22.   Application.UnLock()
  23. End Sub
  24. </script>
  25. </head>
  26. <body>
  27. </body>
  28. </html>
Then I try to reach the values of from my loged_in.aspx like this:

Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
  2. <html>
  3. <head>
  4. <title>Welcome</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <script runat="server">
  7. Sub Page_Load()
  8.   Session("logon") = Request("logon")
  9.   logon.Text = Session("logon")
  10.   sessid.Text = Session.SessionID
  11.   app.Text = Application("namn")
  12.   datum.Text = Application("datum")
  13.   aktiva.Text = Application("on")
  14. End Sub
  15. </script>
  16. </head>
  17. <body>
  18. <form runat="server">
  19.   You are <asp:label ID="logon" runat="server"/>
  20.    with sessionsid: <asp:label ID="sessid" runat="server"/>
  21.    in the application <asp:label ID="app" runat="server"/>.<br/>
  22.   The applicationen has been running since <asp:label ID="datum" runat="server"/>.<br/>
  23.   The number of active users in this application: <asp:label ID="aktiva" runat="server"/><br/>
  24. <a href="loggaut.aspx">Log out</a>
  25. </form>
  26. </body>
  27. </html>
BUT all the variables from the global.asax are emtpy :confused: : Like
-datum
-aktiva

I am sure this basic for you, but I have been trying to find the solution for a while now.
//Matti
May 14 '06 #1
0 2008

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: Sahil Malik [MVP] | last post by:
So here's a rather simple question. Say in an ASP.NET application, I wish to share common constants as static variables in global.asax (I know there's web.config bla bla .. but lets just say I...
1
by: WJ | last post by:
I am storing my global variables in the application "global.asax" file, some are nd some are not sensitive. Is it OK to store sensitive data on Global variables. Please note: some are created at...
8
by: Simone Chiaretta | last post by:
I've a very strange behaveour related to a website we built: from times to times, something should happen on the server, and all static variables inside the web application, both defined inside aspx...
3
by: Craig | last post by:
In my global.asax file I have a variable in the application on start event called Application("FolderName"). On the development PC the variable is set as Application("FolderName") =...
4
by: Kim Bach Petersen | last post by:
I would like to record user behavior data stored in session variables. Since the data is modified throughout each session it seemed obvious to store the data when the session terminates - using...
2
by: Nathan Sokalski | last post by:
I would like to access variables and functions that I declare in the Global.asax.vb file. However, I am having trouble doing that. What does the declaration have to look like in the Global.asax.vb...
3
by: Jack | last post by:
Hello, I am trying to add how many users online to my website. I have setup a Global.asax and need some morehelp. I have the following Global.asax Public Class Global Inherits...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...

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.