Thanks for your detailed reply Greg.
In my case, all pages are set to Implicit Instancing -OFF. The Session has a Property for each page, where it is created - so the session owns it, normally only 1 page at a time is opened.
On Page Menu:
Session.ShowReportConfigPage
In Session - the page is a property of Session:
Dim FoundOne As Boolean
If Self.PageCount > 0 Then
For i As integer = 0 to Self.PageCount -1
If Self.PageAtIndex(i).Name = "ReportMgmntPage" Then FoundOne = True
Next i
End If
If FoundOne = False Then
frmReportMgmntPage = New ReportMgmntPage
frmReportMgmntPage.Show
For i As integer = 0 to Self.PageCount -1
If Self.PageAtIndex(i).Name <> "ReportMgmntPage" Then
Dim n As String = Self.PageAtIndex(i).Name
Self.PageAtIndex(i).Close
end If
Next i
Else
For i As integer = 0 to Self.PageCount -1
If Self.PageAtIndex(i).Name <> "ReportMgmntPage" Then
Dim n As String = Self.PageAtIndex(i).Name
Self.PageAtIndex(i).Close
end If
Next i
frmReportMgmntPage.Visible = True
End If
Return
If there were a reference back to the Session, it would be to the database - Sesson.db.xxx, since the Session has opened the database and holds all references to it; OR to a property of the Session. But since the Session owns the Page, would that remove the circular reference problem?
Another possible problem may be how I am using IPS sockets. I have one instantiated in the App. This communicates with each Session bi-directionally. There are no instances of it in any object other than the App, but data is sent to it from the Session.Page to Session to App. And the other way around. Is this a problem? The idea behind this was to have a single connection to another running app. App pages need the same info sent to it (from the other app), but not all will send anything, or even something, to the other running app - so it is mostly one way communication (Other app -> Web app).
I also use dialogs. Do they need to be destroyed programmatically after each use, or when done with the page?
Same with Containers. Some are placed on the page at design time, some are instantiated as a property of the page, and then EmbedWithin the page then AddHandler is used.
In the last case, where AddHandler is used, they need to be explicitly Removed during the pages close event - correct?
However, if the Container objects do NOT use AddHandler, then there is no destruction I need to do correct?
In a pages Open Event
cntGridMstr2 = New cntGridMaster //No addHandler, but the cntGridMaster is a container object, property cntGridMstr2 is private to the page
mnuNavMain = New Navigator_Main //mnuNaveMain is a page property, Navigator_Main is a series of Container objects
mnuNavMain.Top = 0
mnuNavMain.Width = Self.Width
mnuNavMain.EmbedWithin(Self, 0, 0, mnuNavMain.Width, mnuNavMain.Height)
AddHandler mnuNavMain.evnt_ShowMenu, AddressOf ShowMenu
AddHandler mnuNavMain.evnt_ShowGate, AddressOf ShowGate
Any problems with what you see above, other than missing the RemoveHandler code?
Thank you again!
Tim