popup window is minimizing when it opens

Posted on 2008-11-09
Last Modified: 2012-05-05
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("'" & "NotePopupFacility.aspx?NoteID=" & Value & "&Facilityid=" & FacilityId & "', '','width=600,height=450,resizable=no,status=no,menubar=no,scrollbars=yes,toolbar=no');")
    End Sub
Question by:mikewilson55
    LVL 29

    Assisted Solution

    by:David H.H.Lee
    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("'" & "NotePopupFacility.aspx?NoteID=" & Value & "&Facilityid=" & FacilityId & "', '','width=600,height=450,resizable=no,status=no,menubar=no,scrollbars=yes,toolbar=no');my_window.focus();")

    Accepted Solution

    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 ="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" />    
    LVL 29

    Expert Comment

    by:David H.H.Lee
    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: HTML5 Specialist

    HTML5 development skills are critical to all developers. HTML5 is the foundation to almost any development process. That's why business, design studios, development shops and other organizations need HTML5 developers. Get your foot in the door as a HTML5 specialist.

    Quite often, your web application, web site, AJAX code or web service does not work in the way you expect it to. In these cases, it may be necessary to "look under the hood" of the http protocol and to look at either client requests, server replies…
    Introduction HyperText Transfer Protocol ( or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
    This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
    Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now