[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to declare a Static variable in Global.asax?

Posted on 2006-11-19
2
Medium Priority
?
1,863 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

650 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