• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

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
  • 2
2 Solutions
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" />    
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.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now