473,725 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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='javas cript'>returnVa lue =
window.showModa lDialog('Datagr id1.aspx', 'xxx');" +
"if(returnV alue == 0) window.open('We bform1.aspx', '_self'); else
window.open('Da tagrid1.aspx', '_self'); </script>";
Page.RegisterSt artupScript("La unch_Report_Win dow",scriptbloc k);

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.Att ributes.Add("on click","javascr ipt:window.retu rnValue
= 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 1760
"Vijay Kerji" <vi*********@ya hoo.com> wrote in message
news:30******** *************** ***@posting.goo gle.com...
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*********@ya hoo.com> wrote in message
news:30******** *************** ***@posting.goo gle.com...
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='javas cript'>returnVa lue =
window.showModa lDialog('Datagr id1.aspx', 'xxx');" +
"if(returnV alue == 0) window.open('We bform1.aspx', '_self'); else
window.open('Da tagrid1.aspx', '_self'); </script>";
Page.RegisterSt artupScript("La unch_Report_Win dow",scriptbloc k);

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.Att ributes.Add("on click","javascr ipt:window.retu rnValue = 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
7985
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 : VBScript and Javascript Client : 1. IE browser. 2. VBForm embedded with WebBrowser control (MS Internet
5
9709
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 click that opens the site in a new and larger window via onclick. My question is, can I have the smaller window automatically close when the user clicks the link to visit the site? I also have a link that merely closes the smaller info window if...
1
3792
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 HTML form to. the actual form-parsing page resides on a server that's uneditable to me since it sits on an inaccessible server. my problem is more irritating than anything; everything double-submits.. when you submit the form, I've forced a...
9
3237
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 it more clear take a look at http://www.ithorizon.co.uk). I have inserted some code below to show what I currently have, but I don't have the knowledge to amend it, can somone please help. <SCRIPT LANGUAGE="JavaScript">
2
18414
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 with an FTP-browser. function popup(url,width,height){ var popupX = (screen.width/2)-(width/2); var popupY = (screen.height/2)-(height/2); var pos = "left="+popupX+",top="+popupY;
7
3226
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 8. Jspw3 opens a popup window (using varname=window.open(...)) but there are now two problems: 1) Opera8 interprets a top,left of 0,0 to be top left of the browser window rather than of the entire screen, unlike the other modern browsers I've...
4
2057
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 people don't like the idea of closing the browser window because it's annoyance to the user
4
34878
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 as a new window. The original window plus the Modally opened Pop remain in a separate window. What I want to do is close the popup and return to the original window with its view state maintained. The control use to fire the popup window...
1
7656
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 tried using two aspx pages with standard controls and all those post-backs and their attributes OnClientClick. Since this didn't work, i reduced it to a default.aspx page opening a pure html-page as a modal dialog.
0
8888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9113
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.