|
-
Oct 5th, 2002, 02:26 AM
#1
Thread Starter
Addicted Member
global inside an aspx file
Is there a way to make a variable global to an entire aspx file? I tried to just sticking it at the top where the declarations for the buttons ect go, but whenever I make changes to this variable they don't seem to stick. any ideas?
-
Oct 5th, 2002, 09:05 AM
#2
Hyperactive Member
You can add variables to the viewstate. It has to be stored as a string and you must a have a <form runat="server"> on every page:-
ViewState("myvar") = "hello"
dim MyVar as string = cstr(ViewState("myvar"))
or for a number
ViewState("myint") = "10"
dim MyVar as string = int32.parse(ViewState("myvar"))
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|