Click to See Complete Forum and Search --> : popup within popup issue
malikamjad
October 17th, 2006, 04:49 AM
hi guys .. i have a problem here .. i have a aspx page within which i am opeinig a popup through javascript its working fine but when i try to open another open popup within opened popup it returns No page found error page within the same popup window .. but at the same time it works thourh Hyperlink. .. whats this...? .. it open up an other _blank window popup ... i dont understand why its not working through javascript code when i call popup within a popup.... can any body solve this issue ...
Thanks..
HanneSThEGreaT
October 18th, 2006, 01:17 PM
Can you post your JavaScript Code which creates both popups ¿ :)
malikamjad
October 19th, 2006, 01:05 AM
<script language="javascript">
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+', resizable=true'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
</script>
...
Response.Redirect("JaveScript:NewWindow('view.aspx?id=25','winName','800','800','yes')") ... this is the syntax to utilize script code .. running well for first popup but second time not working and return Page Not found with in the same popup window... i also used
Response.Redirect("JaveScript:window.Open('same parameters ...')") .. but this also not working ...
.. one more thing direct response.redirect("view.aspx?id=25") is working here in sencond popup.
thanks ...
HanneSThEGreaT
October 19th, 2006, 02:36 AM
Hello again!
I quickly worked out this for you. It opens a popup after a few seconds, then, it opens up another popup.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popupWin() {
text = "<html>\n<head>\n<title>Pop Window 1</title>\n<body>\n";
text += "<center>\n<br>";
text += "<a href='http://www.ncc-cla.com'><h2>NCC</h2></a>";
text += "</center>\n</body>\n</html>\n";
setTimeout('windowProp(text)', 3000); // delay 3 seconds before opening
}
function NewWinOpen() {
text2 = "<html>\n<head>\n<title>Pop Window 2</title>\n<body>\n";
text2 += "<center>\n<br>";
text2 += "<a href='http://www.codeguru.com/forum/showthread.php?p=1475827#post1475827'><h2>Popup Within Popup Issue</h2></a>";
text2 += "</center>\n</body>\n</html>\n";
setTimeout('windowProp2(text2)', 3000);
}
function windowProp(text) {
newWindow = window.open('','newWin','width=500,height=500');
newWindow.document.write(text);
setTimeout('NewWinOpen()', 2000);
}
function windowProp2(text2) {
newWindow2 = window.open('','newWin2','width=300,height=100');
newWindow2.document.write(text2);
}
// End -->
</script>
</HEAD>
<BODY onLoad="popupWin()">
Is that what you want ¿
malikamjad
October 19th, 2006, 04:22 AM
thanks for the work u done and for the time u spare for me ... your code working fine at a part ...
the but the situation remain the same ...
actually i am doing work in asp.net and i have an image button on a grid. on its Item Command i run code ...
response.redirect("JavaScript:NewWindow('view.aspx?id=20','view','800','800')") ... "NewWindow" then javascript code i mentioned earlier ... this works fine and first popup window open up properly.Now there is an other image button placed on grid on this first popup and on this popup window i repeat the process ..calling the javascript code on the same item command postback of image button ..BUTT here popup doesnt open and page not found 404 page open in the window(self)...!!!!! why ... all this is unexpected!!! i can understand where is, and what is missing here ... if i use link button on first popup window and call page it open up in the new window but i cant handle window proportions and other properties ... this is all what problem is going on ... hope u now understand the problem ... thanks agian for being with me and giving some time ... take care.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.