473,388 Members | 1,340 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Window.Close Opens New Annoying Window

Hi,
Please go through the following scenario.
1)On Button click, Parent window opens a child window using
showModalDialog
2)Button is a server control and showModalDialog script is registered
using the following code:

string scriptblock = "<script language='javascript'>returnValue =
window.showModalDialog('Datagrid1.aspx', 'xxx');" +
"if(returnValue == 0) window.open('Webform1.aspx', '_self'); else
window.open('Datagrid1.aspx', '_self'); </script>";
Page.RegisterStartupScript("Launch_Report_Window", scriptblock);

3)In the Child window there is a SAVE server button control and the
following
code is added in PageLoad for the button:
Button_Save.Attributes.Add("onclick","javascript:w indow.returnValue
= 0;window.close();");

4)When OnSave button is clicked, a new child window is getting opened
though the modal window is closed, which is annoying.

Any intelligent guess/suggestoins are appreciated.

Thanks
Vijay K Kerji
Nov 18 '05 #1
2 1740
"Vijay Kerji" <vi*********@yahoo.com> wrote in message
news:30**************************@posting.google.c om...
Any intelligent guess/suggestoins are appreciated.


Postback of a modalDialog will post back to a new window unless you
encapsulate the entire code in an <iframe> tag.
Nov 18 '05 #2
Vijay,

Try putting a line

<base target=_self>

in the <Head> section of the page shown in the modal window.

Eliyahu

"Vijay Kerji" <vi*********@yahoo.com> wrote in message
news:30**************************@posting.google.c om...
Hi,
Please go through the following scenario.
1)On Button click, Parent window opens a child window using
showModalDialog
2)Button is a server control and showModalDialog script is registered
using the following code:

string scriptblock = "<script language='javascript'>returnValue =
window.showModalDialog('Datagrid1.aspx', 'xxx');" +
"if(returnValue == 0) window.open('Webform1.aspx', '_self'); else
window.open('Datagrid1.aspx', '_self'); </script>";
Page.RegisterStartupScript("Launch_Report_Window", scriptblock);

3)In the Child window there is a SAVE server button control and the
following
code is added in PageLoad for the button:
Button_Save.Attributes.Add("onclick","javascript:w indow.returnValue = 0;window.close();");

4)When OnSave button is clicked, a new child window is getting opened
though the modal window is closed, which is annoying.

Any intelligent guess/suggestoins are appreciated.

Thanks
Vijay K Kerji

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vetrivel | last post by:
Application architecture : Develop interface between two existing systems, a. Enterprise CRM system b. Web based intranet system. Environment : Intranet Server : IIS and ASP. Script :...
5
by: Carol Lyn | last post by:
Could use your assistance with this. I have a window that opens via onclick and it is a small window with info about a site. If the user is interested in visiting that site, there is a link to...
1
by: Display Name | last post by:
the customer I'm developing a site for uses a canned form-parsing page that allows her to have an email subscription opt-in page add emails to a list she can manage using a link that you point your...
9
by: Graham | last post by:
What I currently have is a page that opens another browser at 800x600, once that is loaded I would like to close the orginal page down while keeping the page that it has just opened open (To make...
2
by: Stefan Sch?rmeli | last post by:
I already read about several problems using firefox and the window.opener property. But obviously it didn't help out. So here is my problem: I got a "Search..." link which opens a new window...
7
by: E Michael Brandt | last post by:
I have been lurking here for some time, and now would like to ask a question of you clever coders: My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the face of the new Opera...
4
by: bbass | last post by:
thanks to all that replyied to my previous post with the following code in question: <a href="merc.htm" target="_new_merc" onfocusout=window.close class="left_link"> i understand that the...
4
by: GrantS | last post by:
I am having a problem closing a popup window opened modally. When I try to close the window (when the user hits save button and the data has been processed), the Popup window opens as a full screen...
1
by: Curious Trigger | last post by:
Hi there, programming with Visual Studio 2005 and ASP.NET 2.0 I want to open a modal dialog from Default.aspx. I searched the net and many newsgroups but I couldn't find any solution. First I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.