A
Andrew Morton
I don't know the correct terminology, but I'm sure there's a better way to
do the following with .aspx pages:-
In global.asax, I create an instance of an entity (basketCentral.vb) which
has subroutines, functions and variables which I want to access from any
page:-
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim basket As NS.basketCentral = New NS.basketCentral
Session("basket") = basket
End Sub
Then to use a public function in it, I use, for example,
userID=Session("basket").logon(username, passwd)
or for a public subroutine,
Session("basket").addToBasket(shopitem)
It works, but is this the "correct" way of doing it? VS.NET prompts with
GetType as soon as I've typed the dot after Session("basket"), which leads
me to think I'm missing something and causing it to use late binding.
Andrew
do the following with .aspx pages:-
In global.asax, I create an instance of an entity (basketCentral.vb) which
has subroutines, functions and variables which I want to access from any
page:-
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim basket As NS.basketCentral = New NS.basketCentral
Session("basket") = basket
End Sub
Then to use a public function in it, I use, for example,
userID=Session("basket").logon(username, passwd)
or for a public subroutine,
Session("basket").addToBasket(shopitem)
It works, but is this the "correct" way of doing it? VS.NET prompts with
GetType as soon as I've typed the dot after Session("basket"), which leads
me to think I'm missing something and causing it to use late binding.
Andrew