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. how to make popup window active

how to make popup window active

Scheduled Pinned Locked Moved Web Development
javascriptdata-structurestoolshelptutorial
4 Posts 2 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.
  • C Offline
    C Offline
    chithra r
    wrote on last edited by
    #1

    hi iam having a aspx page which contains a textbox and a button.i have written javascript code for passing values between a popup window and the parent(aspx)page.upto this everything works fine.after taking value from pop up window i want to make the pop up window active(that is parent window should not be clicked unless pop up window closes.)but in my case the pop up window gets minimised when i click outside in the parent window.and one more problem with the page is it gets minimised when i click outside the window. iam giving the javascript code here for your reference. function to open pop up window.. string scr = @"<script> function update(elemValue) { document.getElementById('ctl00_LondonContentPlaceHolder3_txtRestName').innerText=elemValue[0]; } </script>"; // register the javascript into the Page Page.RegisterClientScriptBlock("update", scr); //add our popup onclick attribute to the desired element on the page (Here, Hyperlink1) lnkTopPick.Attributes.Add("onclick", "window.open('lrs_SearchRestToppick.aspx',null,'left=190, top=225, height=250, width= 465, status=n o, resizable= no, scrollbars= no, toolbar= no,location= no, menubar= no');"); function to pass value protected void Page_Load(object sender, EventArgs e) { string scr = @" <script> function Done() { var RestName=document.getElementById('txtRestName').value; var RestDesc=document.getElementById('txtRestDesc').value; var ret= new Array(RestName,RestDesc); window.opener.update(ret); window.close(); } </script>"; Page.RegisterClientScriptBlock("done", scr); }

    pintoo

    V 1 Reply Last reply
    0
    • C chithra r

      hi iam having a aspx page which contains a textbox and a button.i have written javascript code for passing values between a popup window and the parent(aspx)page.upto this everything works fine.after taking value from pop up window i want to make the pop up window active(that is parent window should not be clicked unless pop up window closes.)but in my case the pop up window gets minimised when i click outside in the parent window.and one more problem with the page is it gets minimised when i click outside the window. iam giving the javascript code here for your reference. function to open pop up window.. string scr = @"<script> function update(elemValue) { document.getElementById('ctl00_LondonContentPlaceHolder3_txtRestName').innerText=elemValue[0]; } </script>"; // register the javascript into the Page Page.RegisterClientScriptBlock("update", scr); //add our popup onclick attribute to the desired element on the page (Here, Hyperlink1) lnkTopPick.Attributes.Add("onclick", "window.open('lrs_SearchRestToppick.aspx',null,'left=190, top=225, height=250, width= 465, status=n o, resizable= no, scrollbars= no, toolbar= no,location= no, menubar= no');"); function to pass value protected void Page_Load(object sender, EventArgs e) { string scr = @" <script> function Done() { var RestName=document.getElementById('txtRestName').value; var RestDesc=document.getElementById('txtRestDesc').value; var ret= new Array(RestName,RestDesc); window.opener.update(ret); window.close(); } </script>"; Page.RegisterClientScriptBlock("done", scr); }

      pintoo

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      chithra.r wrote:

      parent window should not be clicked unless pop up window closes

      Did you consider using ShowModalDialog?

      Vasudevan Deepak Kumar Personal Homepage
      Tech Gossips
      A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

      C 1 Reply Last reply
      0
      • V Vasudevan Deepak Kumar

        chithra.r wrote:

        parent window should not be clicked unless pop up window closes

        Did you consider using ShowModalDialog?

        Vasudevan Deepak Kumar Personal Homepage
        Tech Gossips
        A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

        C Offline
        C Offline
        chithra r
        wrote on last edited by
        #3

        yep..i have tried showmodal dialog also..but it is not working...the thing is the pop up window get minimized when i click outside (in the parent window),which means it is not active.

        pintoo

        V 1 Reply Last reply
        0
        • C chithra r

          yep..i have tried showmodal dialog also..but it is not working...the thing is the pop up window get minimized when i click outside (in the parent window),which means it is not active.

          pintoo

          V Offline
          V Offline
          Vasudevan Deepak Kumar
          wrote on last edited by
          #4

          It can not. When a ShowModalDialog is shown, the parent window is not clickable at all. Check out this page which has an example: http://msdn2.microsoft.com/en-us/library/ms536759(VS.85).aspx[^]

          Vasudevan Deepak Kumar Personal Homepage
          Tech Gossips
          A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

          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