Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP.NET (VB.NET) - Pop Up Window Issue

Posted on 2004-08-21
3
Medium Priority
?
24,560 Views
Last Modified: 2013-11-28
Hi,

I am having a main window and I am opening a pop-up window from this main window. From the pop-up window I need to open another pop-up as a modal window. When I open this model window all controls in the scond pop-up vanishes and once the user enters  the value in the third pop-up window the controls in the second pop-up window regains all its control. I don't want to refresh the second pop-up after the modal dialog is closed. That I can do with windows.opener.location.href. I want the second pop-up not to loose the controls when another modal dialog is opened from the same.

Thanks,
Prasanna
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 400 total points
ID: 11862464
Hi

Are you talking among the lines of this:?

Main Page
main.html
==============
<html>
<head>
<title>Test Main Page</title>
</head>
<body>
<input type="button" value="Launch First Popup" onclick="window.open('firstPopup.html','','width=400,height=400');">
</body>
</html>

First Popup Window
firstPopup.html
==============
<html>
<head>
<title>Test First Popup Window</title>
<script language="javascript">
<!--

//Below function will not hide launchModal button because if the user has a popup blocker, you're screwed
function hideControls() {
   var alltags = (document.getElementsByTagName) ? document.getElementsByTagName("*") : (document.all) ? document.all : document.layers;
   for (var i=0;i<alltags.length;i++) {
      if (alltags[i].name=="launchModal" || alltags[i].tagName=="BODY" || alltags[i].tagName=="HTML") {
         continue;
      } else {
         (document.layers) ? alltags[i].visibility="none" : alltags[i].style.visibility="hidden";
      }
   }
}

function showControls() {
   var alltags = (document.getElementsByTagName) ? document.getElementsByTagName("*") : (document.all) ? document.all : document.layers;
   for (var i=0;i<alltags.length;i++) {
      (document.layers) ? alltags[i].visibility="show" : alltags[i].style.visibility="visible";
   }
}

// -->
</script>
</head>
<body>
<input type="button" value="Launch Modal Dialog" name="launchModal" onclick="hideControls();window.showModalDialog('modalPopup.html',window);showControls();"><br>
NOW, A LOT OF TEST STUFF
<p>&lt;p&gt;THIS IS A <P> TAG!&lt;/p&gt;</p>
<div>&lt;div&gt;THIS IS A <DIV> TAG!&lt;/div&gt;</div>
<span>&lt;span&gt;THIS IS A <SPAN> TAG!&lt;/span&gt;</span><br>
<input type="button" value="THIS IS A BUTTON!"><br>
<input type="submit" value="THIS IS A SUBMIT BUTTON!"><br>
<input type="reset" value="THIS IS A RESET BUTTON!"><br>
<input type="text" value="THIS IS TEXTFIELD!"><br>
<input type="password" value="THIS IS PASSWORD!"><br>
<textarea>THIS IS A TEXTAREA</textarea>
</body>
</html>


This firstPopup.html is the brain behind this. It popups a modal window and hides all the elements on the page that have tags surrounding them (except the first button, but you can disable that, and for all text not in tags, just put <span> around them).

It uses the fact that it does hideControls, then opens the modal dialog, but because modal dialog stops Javascript on main page, when it closes, it does showControls. If you use a DHTML equivalent or a normal window, you'd need to use onunload="opener.showControls();".


Regards,
Zyloch
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will learn how to count occurrences of each item in an array.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

722 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