473,386 Members | 1,763 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,386 software developers and data experts.

Closing Modal dialog

Tim
I have a page that is opening another page using the showmodaldialog.

In the page being shown there are two asp buttons. When the code
finishes in the click event for either button I want to close the
modal window.

So on the click event of both buttons I put in:
me.registerstartupscript("<script
language='javascript'>window.close();</script>").

The problem is that for some reason when the asp buttons are clicked
the application instead of posting back to the same window opens an
entirely different window. The javascript runs fine and closes the
third window but I can't figure out what is making .net open the third
window.

I saw one posting to this news group where the programmer had the same
issue but it was never resolved. Any help would be greatly
appreciated.

Thanks!
Nov 16 '05 #1
3 6265
This behavior is by design in IE. The workaround is to put your entire page
within an iframe. You can then post back as expected.

Ken
"Tim" <ti*@sstechs.com> wrote in message
news:cd**************************@posting.google.c om...
I have a page that is opening another page using the showmodaldialog.

In the page being shown there are two asp buttons. When the code
finishes in the click event for either button I want to close the
modal window.

So on the click event of both buttons I put in:
me.registerstartupscript("<script
language='javascript'>window.close();</script>").

The problem is that for some reason when the asp buttons are clicked
the application instead of posting back to the same window opens an
entirely different window. The javascript runs fine and closes the
third window but I can't figure out what is making .net open the third
window.

I saw one posting to this news group where the programmer had the same
issue but it was never resolved. Any help would be greatly
appreciated.

Thanks!

Nov 16 '05 #2

Ken can you explain a little more. I have been reading into the iframe
and I don't see how this helps me.

What I have is two pages. The first holds the information already in the
database. Via radio buttons and command buttons the user can select to
edit an existing value or enter a new value. Upon click of the edit or
add I am (if edit) validating via java script then popping up a dialog
window to show the value. In that second window there are two buttons
cancel / save. Now with the click event of both of those buttons the
window should close. Now with the iframe are saying to use it instead of
the dialog window or inside of the dialog window? And if inside how to I
force it to post back to the dialog window instead of opening another
window?
Also if you know I would like to know why IE was designed to do this, I
can't figure out for the life of me why this would make sense.

Thank you for your time I really appreciate it.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3

I figured out how to use the iframe to accomplish this. Thanks Ken.

Still not sure why they developed IE to do that though. I can't think of
a reason why I would want a modal dialog window to post to another page.
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #4

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

Similar topics

2
by: Gilles T. | last post by:
Hi, How I can refresh a modal dialog in asp.net? I open a modal dialog in first with a dropdownlist. To add a element in my dropdownlist (table), I open a second modal dialog to ask element and...
1
by: Randy A. Ynchausti | last post by:
Dear all, Within a C# application, I need to start a background thread that: 1) watches for a dialog to appear 2) finds a button labeled "OK" on the dialog 3) pushes the button 4)...
0
by: Andrew | last post by:
I get a Null Reference Exception if I close a modeless form (that is, a form displayed using Show()) when a selection is made from a ComboxBox. If the form is modal (displayed using ShowDialog())...
3
by: Andrew | last post by:
I get a Null Reference Exception if I close a non-modal dialog (that is, a form opened with Show()) when a selection is made from a ComboBox. The error message refers to Unsafe Native Methods, but...
6
by: sramruttun | last post by:
hi I open a pop up window using window.showModalDialog. How can I close the parent window after the pop up appears ?
10
by: Guadala Harry | last post by:
I have a modal dialog that currently does all of the following except item 4. 1. lets users select a graphic from a list of thumbnails (and when selected, displays the full-size image in a...
4
by: rdemyan | last post by:
I'm using code from the following web page to open the API Browse Folder dialog http://www.mvps.org/access/api/api0002.htm It all works fine. But if the dialog box is open and the user closes...
23
by: Chukkalove | last post by:
Im sorry, I dont know the correct description for a hierarchy of parent and child forms. I have a main form that opens a child form modally. This child form in turn opens it's own child form...
3
by: Mike Hofer | last post by:
Okay, here's the situation: we want to be able to display ASPX pages in an UpdatePanel. The reasons for this are performance related. The site in development uses *lots* of modal popups from some...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.