Hi
I have 6 variables that i want to keep after a postback. I have achieved it
by making them static, is this correct procedure?
Thanks
Depends on where they are, and what you want their scope to be.
If you want them to stick around for the entire life time of the
user's session then you should put them in the Session object (it's a
member of the Page, and also available from other classes via
HttpContext.Current.Session).
If you're coding in C# (sounds like you are), don't do that. Static
(Shared) in VB, means that all users of your site will be modifying
the same copy of the variable. If two users are signed on, they'll
walk all over that variable, and you'll get very strange results.
Hope this helps,
Mike