Global.asax Problem

OCCS_Jedi_Knight

New member
Joined
Jul 2, 2004
Messages
1
Programming Experience
3-5
I am working with Global variables, and havent run into any sort of problem until now:



VB.NET:
<%@Application Classname="myGlobals"%>[/left]
[left]<%@import namespace="System"%>[/left]
[left]<%@import namespace="System.collections"%>[/left]
[left]<script language="vb" runat="server"> [/left]
[left]Public shared sGreeting as String = "this is a test?"[/left]
[left]Public shared tst_tbl1 as Hashtable[/left]
[left]Public shared tsttbl1_sync as Hashtable	[/left]
[left]Public shared Key [/left]
[left]</script>



All of the above code resides in my global.asax file and as far as the strings go i can:




VB.NET:
label1.text = myglobals.sGreeting



and it will write "this is a test?" to the screen. The problem I am having lies in trying to do something like this:



Code:
VB.NET:
myglobals.tst_tbl1 = myglobals.tst_tbl1.Add(key, value)


I get an error saying that the expression doesnt return a value. If i try to do something like this:




VB.NET:
Dim hs_tbl as hashtablehs_tbl = new hashtable hs_tbl.Add("OH","Ohio") hs_tbl.Add("OH1","Ohio")myglobals.tst_tbl1 = hs_tbl



I get the same error...does anyone know a work around for this or another possible solution?
 
Top Bottom