Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Popup Problem

Popup Problem

Scheduled Pinned Locked Moved ASP.NET
helpquestion
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sri_con3
    wrote on last edited by
    #1

    hi, I have a problem with Popup window in IE7 when ever i create a popup window and i try to close tat popup window its creating a new popup window. with same url. when i clik on this second popup windwo then its closing. code: Default.aspx function OpenAnotherWindow() { var name = document.getElementById("txtName").name; WindowName="test"; var left, top; left = (window.screen.availWidth - 400)/2; top = (window.screen.availheight - 250)/2; settings= "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, top="+ top +", left="+left+", height=250,width=400"; var id = window.showModalDialog('DialogPage.aspx?name='+ document.form1.txtName.value,WindowName, settings); document.getElementById("txtName").value=id; }

    default.aspx.cs page_load btnOpenWindow.Attributes.Add("onclick", "return OpenAnotherWindow()"); dialogpage.aspx function CloseThisWindow() { var myName = "Popup"; var o = new Object(); o.orglevid = "1"; o.orgname = "test"; window.returnValue=o.orgname; window.close(); return true; }

    please help me out not this issue is in IE 7 only in IE 6 its working fine sri

    G R 2 Replies Last reply
    0
    • S sri_con3

      hi, I have a problem with Popup window in IE7 when ever i create a popup window and i try to close tat popup window its creating a new popup window. with same url. when i clik on this second popup windwo then its closing. code: Default.aspx function OpenAnotherWindow() { var name = document.getElementById("txtName").name; WindowName="test"; var left, top; left = (window.screen.availWidth - 400)/2; top = (window.screen.availheight - 250)/2; settings= "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, top="+ top +", left="+left+", height=250,width=400"; var id = window.showModalDialog('DialogPage.aspx?name='+ document.form1.txtName.value,WindowName, settings); document.getElementById("txtName").value=id; }

      default.aspx.cs page_load btnOpenWindow.Attributes.Add("onclick", "return OpenAnotherWindow()"); dialogpage.aspx function CloseThisWindow() { var myName = "Popup"; var o = new Object(); o.orglevid = "1"; o.orgname = "test"; window.returnValue=o.orgname; window.close(); return true; }

      please help me out not this issue is in IE 7 only in IE 6 its working fine sri

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      The reason for the second window is that you are posting the form from the dialog. As you can not post a form to a dialog window, it will be posted to a new window. Return false from the CloseThisWindow function, so that the form is not posted. If you don't want the form on the main page to be posted immediately after the dialog closes, you should return false from the OpenAnotherWindow function also.

      --- b { font-weight: normal; }

      S 1 Reply Last reply
      0
      • G Guffa

        The reason for the second window is that you are posting the form from the dialog. As you can not post a form to a dialog window, it will be posted to a new window. Return false from the CloseThisWindow function, so that the form is not posted. If you don't want the form on the main page to be posted immediately after the dialog closes, you should return false from the OpenAnotherWindow function also.

        --- b { font-weight: normal; }

        S Offline
        S Offline
        sri_con3
        wrote on last edited by
        #3

        Hi, Thanx for ur response, but i traied all these ways and still my application is acting like tat only. is there any other way to this problem. pls inform me thanx

        sri

        G 1 Reply Last reply
        0
        • S sri_con3

          hi, I have a problem with Popup window in IE7 when ever i create a popup window and i try to close tat popup window its creating a new popup window. with same url. when i clik on this second popup windwo then its closing. code: Default.aspx function OpenAnotherWindow() { var name = document.getElementById("txtName").name; WindowName="test"; var left, top; left = (window.screen.availWidth - 400)/2; top = (window.screen.availheight - 250)/2; settings= "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, top="+ top +", left="+left+", height=250,width=400"; var id = window.showModalDialog('DialogPage.aspx?name='+ document.form1.txtName.value,WindowName, settings); document.getElementById("txtName").value=id; }

          default.aspx.cs page_load btnOpenWindow.Attributes.Add("onclick", "return OpenAnotherWindow()"); dialogpage.aspx function CloseThisWindow() { var myName = "Popup"; var o = new Object(); o.orglevid = "1"; o.orgname = "test"; window.returnValue=o.orgname; window.close(); return true; }

          please help me out not this issue is in IE 7 only in IE 6 its working fine sri

          R Offline
          R Offline
          RaviJJain
          wrote on last edited by
          #4

          add below code regards ravi

          S 1 Reply Last reply
          0
          • R RaviJJain

            add below code regards ravi

            S Offline
            S Offline
            sri_con3
            wrote on last edited by
            #5

            Hi Ravi, Thanx for ur response.i traid those tags.even then also its opening a new popup window but the difference is parent form is getting the focus. i am sending the popup window's code (runtime) Note: in form tag action attribute is automatically assigning aaa Dialog Page function CloseThisWindow() { var myName = "Popup"; var o = new Object(); o.orglevid = "1"; o.orgname = "test"; window.returnValue=o.orgname; window.close(); }

            sri

            1 Reply Last reply
            0
            • S sri_con3

              Hi, Thanx for ur response, but i traied all these ways and still my application is acting like tat only. is there any other way to this problem. pls inform me thanx

              sri

              G Offline
              G Offline
              Guffa
              wrote on last edited by
              #6

              sri_con3 wrote:

              Thanx for ur response, but i traied all these ways and still my application is acting like tat only.

              Then you probably did something wrong...

              sri_con3 wrote:

              is there any other way to this problem.

              Yes, if you don't want the form submitted you can avoid using a submit button (which is what the asp:Button control produces). Use an input tag with type="button" instead.

              --- b { font-weight: normal; }

              S 1 Reply Last reply
              0
              • G Guffa

                sri_con3 wrote:

                Thanx for ur response, but i traied all these ways and still my application is acting like tat only.

                Then you probably did something wrong...

                sri_con3 wrote:

                is there any other way to this problem.

                Yes, if you don't want the form submitted you can avoid using a submit button (which is what the asp:Button control produces). Use an input tag with type="button" instead.

                --- b { font-weight: normal; }

                S Offline
                S Offline
                sri_con3
                wrote on last edited by
                #7

                hi, thanx for your response I checked every thing in my code. It is working fine in IE6 but when it comes to IE7 its givin theis problem. Is there any alternative for it. i have to use tat asp:button control not the input control

                sri

                G 1 Reply Last reply
                0
                • S sri_con3

                  hi, thanx for your response I checked every thing in my code. It is working fine in IE6 but when it comes to IE7 its givin theis problem. Is there any alternative for it. i have to use tat asp:button control not the input control

                  sri

                  G Offline
                  G Offline
                  Guffa
                  wrote on last edited by
                  #8

                  As I explained before, return false from the event, and the form will not get posted.

                  --- b { font-weight: normal; }

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups