B
Bruno Alexandre
Hi guys,
I'm using a session to save an ArrayList, so I do not read Database
everytime user reload the page or enter the site (the Data is consistent for
all entire session time when the user is on the site).
I'm using a Class called ProductBoxes and inside I have a public property
of Object type and I call from the PageLoad event
dim boxes as new ProductBoxes
boxes.ProductSession = session("something")
and it works ok, with all the subs and function of the class, so I can
populate the page with 5 boxes (images) in the way I want.
but when I raise btnLeft_OnClick HOW CAN USE A SUB UNDER my class?
Protected Sub btnMoveLeft_Click(ByVal sender As Object, ByVal e As
System.Web.UI.ImageClickEventArgs)
boxes.moveLeft()
End Sub
if I do:
dim boxes as new ProductBoxes
boxes.moveLeft()
I get an error when I use the session... because I'm creating a NEW instance
of the object and I need to use the old one, the old one have the session
with the data that I need
how can I do this? or all the Data in a Class as the life of a "refresh"
page? do I need to always save the data in a HiddenField so I can get it
again and populate the new instance??? but that's crazy isn't it?
--
Thank you in Advance.
Bruno Alexandre
(a Portuguese in Denmark)
I'm using a session to save an ArrayList, so I do not read Database
everytime user reload the page or enter the site (the Data is consistent for
all entire session time when the user is on the site).
I'm using a Class called ProductBoxes and inside I have a public property
of Object type and I call from the PageLoad event
dim boxes as new ProductBoxes
boxes.ProductSession = session("something")
and it works ok, with all the subs and function of the class, so I can
populate the page with 5 boxes (images) in the way I want.
but when I raise btnLeft_OnClick HOW CAN USE A SUB UNDER my class?
Protected Sub btnMoveLeft_Click(ByVal sender As Object, ByVal e As
System.Web.UI.ImageClickEventArgs)
boxes.moveLeft()
End Sub
if I do:
dim boxes as new ProductBoxes
boxes.moveLeft()
I get an error when I use the session... because I'm creating a NEW instance
of the object and I need to use the old one, the old one have the session
with the data that I need
how can I do this? or all the Data in a Class as the life of a "refresh"
page? do I need to always save the data in a HiddenField so I can get it
again and populate the new instance??? but that's crazy isn't it?
--
Thank you in Advance.
Bruno Alexandre
(a Portuguese in Denmark)