Hi Derek,
First you should realize that Context and Session is not the same thing. The session stores all the contexts active for each session, and if you have that second "window" (context) opening (created) on a different session, you will need another approach, if at all possible.
So, what you are talking about here is a different context within the same session, assuming the new context is created within the new session in the first place.
A Form with a TextBox showing the number of instances created, which equals the number of contexts created, and storing references to the other form and it's context in a session variable can give you some ideas on what can be done to make sure the former context is destroyed, but it will not close the browser tab for you, just make sure the context is destroyed.
The code below is just a skeleton, and you will need more error checking to make it feasible to use, but this is what I would try to start with:
Imports Gizmox.WebGUI.Forms
Public Class SessionTest
Public Shared counter As Integer = 0
Private Sub SessionTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
counter += 1
TextBox1.Text = counter.ToString()
If Context.Session("TestForm") IsNot Nothing Then
Dim f As SessionTest = CType(Context.Session("TestForm"), SessionTest)
Dim c As Gizmox.WebGUI.Common.Interfaces.IContext = CType(Context.Session("Testcontext"), Gizmox.WebGUI.Common.Interfaces.IContext)
If c IsNot Me.Context Then
c.Terminate(False)
End If
End If
Context.Session("TestForm") = Me
Context.Session("Testcontext") = Me.Context
End Sub
End Class
Regarding the serialization of the form's data, you can find information on that in the Serialization article on the wiki here. In that article there is a reference to a codesample that you should study.
Hope this helps,
Palli