Solved

How to declare a Static variable in Global.asax?

Posted on 2006-11-19
2
1,835 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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

24 Experts available now in Live!

Get 1:1 Help Now