?
Solved

How to declare a Static variable in Global.asax?

Posted on 2006-11-19
2
Medium Priority
?
1,855 Views
Last Modified: 2008-01-09
I'm using Visual Studio 2005 and VB.NET.  I'm in the Global.asax file.  I want to make a global variable that will be used by all pages and sessions.  I declared a practice variable "thisGlobals" to see how to declare a Static variable, but I get the error "'Static' is not valid on a member variable declaration".    I can't see where I'm missing it.  Can you show me how to declare a Static variable?  Thank you.

<%@ Application Language="VB" %>
<script runat="server">
    Public Static thisGlobals As String

...the other Global.asax code goes here.

</script>
0
Comment
Question by:psmithphil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 29

Accepted Solution

by:
Nightman earned 2000 total points
ID: 17975451
Use 'Shared' in VB.NET
Static is for C#
0
 

Author Comment

by:psmithphil
ID: 17975522
Thank you, Nightman!   In the Help, I never found anything that said this.  
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question