Solved

How to declare a Static variable in Global.asax?

Posted on 2006-11-19
2
1,837 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
2 Comments
 
LVL 29

Accepted Solution

by:
Nightman earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now