D
Dean
I finally got class session variables to work by putting the following in
global.asax in the session_start:
dim myDBComp as DBComp = new DBComp........
session("myDBComp") = myDBComp
In each aspx codebehind module I can define my object right after the class
definition as so:
dim myDBComp as DBComp
The problem I had was where to put the instantiation:
myDBComp = CType(session("myDBComp"), DBComp)
I can't put it up with the definition as the compiler wants only
declarations up there.
I can't put it in any of the methods because it loses scope outside the
methods.
I finally found that it works if I put in in initializecomponent()
But then it disappears if I make any changed to the UI in the aspx page.
Where is it supposed to go?
Thanks,
Dean
global.asax in the session_start:
dim myDBComp as DBComp = new DBComp........
session("myDBComp") = myDBComp
In each aspx codebehind module I can define my object right after the class
definition as so:
dim myDBComp as DBComp
The problem I had was where to put the instantiation:
myDBComp = CType(session("myDBComp"), DBComp)
I can't put it up with the definition as the compiler wants only
declarations up there.
I can't put it in any of the methods because it loses scope outside the
methods.
I finally found that it works if I put in in initializecomponent()
But then it disappears if I make any changed to the UI in the aspx page.
Where is it supposed to go?
Thanks,
Dean