I was workin on a similar kind of issue some time ago, I used Page.RegisterStartupScript method.
I had to produce a pop up window with a chart and related data based on several listbox selections on the click of a button. Following is a VB
.NET code that I wrote to achieve what I just explained. Hope this is what you are looking for.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strPop As String
Dim file As String
file = "chartmaker.aspx?chType=" & lst_ChType.SelectedValue & "&Table=" & lst_Table.SelectedValue & "&Values=" & lst_Values.SelectedValue & "&Categories=" & _
lst_Categories.SelectedValue & "&Series=" & lst_Series.SelectedValue
& "window.open('" & file & "','Report','menubar=1,status=1,scrollbars=1,resiz able=1')" & vbCrLf _
& "</script>" & vbCrLf