Hello,
I have an .aspx page, on that page I have an .ascx web control, during the prerender event of the web control I'm instantiating a middle tier component that queries a database and builds a collection of objects. I'm then using this collection to populate an asp:table on the web control.
FWIW, the middle tier component is a dll that's in the wwwroot\bin directory and has business logic regarding the state of the items in the collection, user permissions, etc.
On the .ascx web control I also have a asp:button, when I click on this button, I'd like to be able to delete an object from this collection, have it delete from the database, etc.
Problem is this middle tier component, even though it's declared outside the prerender event, is null inside the event handler for the asp:button. Is there anyway to keep this middle tier component in memory as long as the page that contains the web control is open?
I was hoping that this middle tier component would kind of have a "life of its own" independent of the data that was on my ASP.NET pages and components.
-Eric