472,782 Members | 1,494 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

AJAX: Closing a modal popup dialog

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 pages, and
we don't want to load all that content until it's requested.

So, what we want to do is place an IFRAME inside an UpdatePanel and,
in the onclick event for the linkbutton or button control, set the SRC
so that the content is loaded on demand. So far, so good.

What I can't seem to figure out, at this point, is how you would go
about closing the modal popup once it's displayed. In theory, the
heirarchy looks like this:

Page
Button/LinkButton
ModalPopupExtender
UpdatePanel
IFrame
Page
OK/Cancel button

I'm relatively new to this Ajax business, but I've manged to figure
out how to get the page to load display in the IFrame when I want it
to, and that's all spiffy. Now I just need to know how to get it to
close in response to the user's actions.

Any help would be greatly appreciated.

Thanks!

Mike
Jul 31 '08 #1
3 3825
I can't answer your specific question, but I would put it all in a panel and
make it invisible unless you call the model popup. That way it wont load in
the page, and the buttons on the panel will close the model popup.

Marc
"Mike Hofer" <kc********@gmail.comwrote in message
news:ba**********************************@i76g2000 hsf.googlegroups.com...
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 pages, and
we don't want to load all that content until it's requested.

So, what we want to do is place an IFRAME inside an UpdatePanel and,
in the onclick event for the linkbutton or button control, set the SRC
so that the content is loaded on demand. So far, so good.

What I can't seem to figure out, at this point, is how you would go
about closing the modal popup once it's displayed. In theory, the
heirarchy looks like this:

Page
Button/LinkButton
ModalPopupExtender
UpdatePanel
IFrame
Page
OK/Cancel button

I'm relatively new to this Ajax business, but I've manged to figure
out how to get the page to load display in the IFrame when I want it
to, and that's all spiffy. Now I just need to know how to get it to
close in response to the user's actions.

Any help would be greatly appreciated.

Thanks!

Mike

Jul 31 '08 #2
On Jul 31, 4:22*pm, "Marc " <RmEaMrO...@imarc.co.ukwrote:
I can't answer your specific question, but I would put it all in a panel and
make it invisible unless you call the model popup. That way it wont load in
the page, and the buttons on the panel will close the model popup.

Marc

"Mike Hofer" <kchighl...@gmail.comwrote in message

news:ba**********************************@i76g2000 hsf.googlegroups.com...
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 pages, and
we don't want to load all that content until it's requested.
So, what we want to do is place an IFRAME inside an UpdatePanel and,
in the onclick event for the linkbutton or button control, set the SRC
so that the content is loaded on demand. So far, so good.
What I can't seem to figure out, at this point, is how you would go
about closing the modal popup once it's displayed. In theory, the
heirarchy looks like this:
Page
* Button/LinkButton
* ModalPopupExtender
* UpdatePanel
* * *IFrame
* * * * Page
* * * * * *OK/Cancel button
I'm relatively new to this Ajax business, but I've manged to figure
out how to get the page to load display in the IFrame when I want it
to, and that's all spiffy. Now I just need to know how to get it to
close in response to the user's actions.
Any help would be greatly appreciated.
Thanks!
Mike- Hide quoted text -

- Show quoted text -
On these three pages we're developing, each page displays up to eight
modal dialog boxes of varying complexity. Several of these dialog
boxes include data repeaters with *lots* of data. We don't want those
pages loading until the user asks for them.

(Don't ask me why these are being displayed in modal dialog boxes.
Let's just say the creative department was smoking some really good
stuff, and no one from the software engineering department was
involved at the time to restrain their "Gee Whiz" impulses.)

So, embedding eight different dialog boxes on a single page with data
repeaters and all their data is impractical on a *very* high traffic
web site. I need to load this stuff dynamically. Further, some of
these pages have unique styling requirements, and I don't want to load
the style sheets for all those dialog boxes and further bloat the
request size. If I can just load the page when it's asked for and it's
size (and script) requirements, that's optimal.

Thanks,
Mike

Jul 31 '08 #3
the easiest way to do this is two hidden buttons, one as the targetid,
and one as the okcontrolid. then from client script just fire the
correct click to open/close the popup. the ok button in the iframe would
call a routine the parent to close (which would just fire the hidden ok
button). when you close the popup set the iframe src to a empty page, so
when you open it again, you don't have the last page displaying

-- bruce (sqlwork.com)

Mike Hofer wrote:
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 pages, and
we don't want to load all that content until it's requested.

So, what we want to do is place an IFRAME inside an UpdatePanel and,
in the onclick event for the linkbutton or button control, set the SRC
so that the content is loaded on demand. So far, so good.

What I can't seem to figure out, at this point, is how you would go
about closing the modal popup once it's displayed. In theory, the
heirarchy looks like this:

Page
Button/LinkButton
ModalPopupExtender
UpdatePanel
IFrame
Page
OK/Cancel button

I'm relatively new to this Ajax business, but I've manged to figure
out how to get the page to load display in the IFrame when I want it
to, and that's all spiffy. Now I just need to know how to get it to
close in response to the user's actions.

Any help would be greatly appreciated.

Thanks!

Mike
Aug 1 '08 #4

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

Similar topics

3
by: Earl Teigrob | last post by:
Can a Modal Dialog Box do forms ASP.NET forms validation from within the Modal Box? I want to pop up a dialog box to the user and have it do its own post backs with validation checking and then...
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...
0
by: Nemisis | last post by:
Hi everyone, Does anyone know how to show an Ajax ModalPopup when a page loads? I would like to use it as a warning dialog for a company record, so that when a user navigates to a companies...
1
by: Samuel Rhodes | last post by:
hi i am using a ajax modal popup to allow the user to search an item and select the required item from the list. whenever i try to search the item, which causes a post back....the modal popup...
0
by: =?Utf-8?B?QWxCcnVBbg==?= | last post by:
I have a situation in which I need to check for data in either of two fields and display an alert if neither field contains data or if both fields contain data when the user clicks on a View...
3
by: SE.Computerguy | last post by:
I am trying to use the AJAX modal popup on a click event from a gridview. Any ideas on implementing this? The AJAX control is looking for a TargetControlID that will trigger the popup but the...
4
by: fran_j_diaz | last post by:
Hi, I have a page with an Ajax modal popup. I would like to know when my Modal popup is opened, my page still able to modify. Is it possible ? (I use Visual Studio 2005, c# )
5
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
Hi all Have a couple of issues with the modal popup extender (asp.net 3.5, vb.net, visual studio 2008): I have created a user control (e-mail enquiry form) which is designed to accept text...
2
by: Alec MacLean | last post by:
Hi, I have a page using AJAX. The page has three modal popups that work fine when I don't have field validators in place. As soon as I put a validator in place, the popup "form" the validator...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.