Hello All

I m fgacing a problem in javascript PopUp window used in ASP.Net Email-Attachment program,
I design a formfor sending email with attachment n a button for attachment "Attach", On click of Attach button
a popup  window appears on with abrowser and Done button is created .
Now problem is that when I attach a file in browser n click Done btn then file goes o main form (using Query String) but the main form appears alse as
popup window while I want main form's Original view.

The code i used for PopUp window is:-
Public Sub PopUp(ByVal url As String)
   Dim popup As String = ""
   Page.RegisterStartupScript("Popup", popup)
End Sub 'PopUp

& call this function on Btnclick of Attacment button:-
PopUp("frmAttach.aspx")

on popup form :-
On btnDone:-

Private Sub btnInDone_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInDone.ServerClick
        If Not (InAttach.PostedFile Is Nothing) Then
            Dim objMM As MailAttachment
            Dim objMail As New MailMessage
            Dim attFile As HttpPostedFile = InAttach.PostedFile
            Dim strFileName As String
            Dim attachFileLength As Integer = attFile.ContentLength
            If attachFileLength > 0 Then
                strFileName = Path.GetFileName(InAttach.PostedFile.FileName)
                InAttach.PostedFile.SaveAs(Server.MapPath(strFileName))
                Dim attach As New MailAttachment(Server.MapPath(strFileName))
                objMail.Attachments.Add(attach)
                Dim str As String
                str = InAttach.PostedFile.FileName
                Response.Redirect("MyEmailPage.aspx?str=" & str)
            End If
        End If
    End Sub

Plz help me
Thanks in advance...