popup window is minimizing when it opens

I have a pop window to display a note but it appears and then minimizes as the page behind seems to be doing a postback.  I have traced the code and the postback occurs before the popup window code runs but visibly the window appears to redraw after the popup appears.  Here's my code under button to call poopup.

Protected Sub wgNote_ClickCellButton(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.CellEventArgs) Handles wgNote.ClickCellButton
        Dim Value As String
        Dim FacilityId As String

        Value = e.Cell.Row.Cells(1).Value
        facilityid = e.Cell.Row.Cells(2).Value

        System.Web.HttpContext.Current.Response.Write("<SCRIPT LANGUAGE=""JavaScript"">" & vbCrLf)
        System.Web.HttpContext.Current.Response.Write("my_window=window.open('" & "NotePopupFacility.aspx?NoteID=" & Value & "&Facilityid=" & FacilityId & "', '','width=600,height=450,resizable=no,status=no,menubar=no,scrollbars=yes,toolbar=no');")
    End Sub
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David H.H.LeeCommented:
Hi mikewilson55,
You can set some trick to enable to pop-up window always open in front. Set focus to opened window.
System.Web.HttpContext.Current.Response.Write("my_window=window.open('" & "NotePopupFacility.aspx?NoteID=" & Value & "&Facilityid=" & FacilityId & "', '','width=600,height=450,resizable=no,status=no,menubar=no,scrollbars=yes,toolbar=no');my_window.focus();")
mikewilson55Author Commented:
I had to create a clientside event - (java function) to popup window rather than dynamically creating the java script in vb code behind area as referenced in my original question.
Placed this in <Head> area:
function wgNotes_ClickCellButtonHandler(gridName, cellId){
      var _cell = igtbl_getCellById(cellId);
    var id = _cell.Row.getCell(1).getValue();
    var id2 = _cell.Row.getCell(2).getValue();
    var popUp = window.open("NotePopupFacility.aspx?NoteID=" + id + "&Facilityid=" + id2, "_blank", "toolbar=0,visible=false,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=450,left=0,top=0");

also refrerenced function in the infragistics aspx code:
          <ClientSideEvents ClickCellButtonHandler="wgNotes_ClickCellButtonHandler" />    

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David H.H.LeeCommented:
Hi mikewilson55,
It is adviceable to separate the javascript code and server script code for easier maintainability and reuseable. However, i'm glad you find the solution that you need here. Cheers.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Applications

From novice to tech pro — start learning today.