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?
mikewilson55Connect With a Mentor Author 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" />    
David H.H.LeeConnect With a Mentor Commented:
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();")
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.