.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Closing ModalPopup from an embedded iframe

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net

I want to put an iframe inside of a ModalPopup and then have a button click on a button inside the iframe trigger the close of the ModalPopup.  I am guessing this is possible by simply attaching a function to the onclick event of the button in the iframe that navigates the DOM to call a javascript function in the parent that ultimately closes the ModalPopup.  Now the targetId of my ModalPopup is a div, so I could see hiding the div manually to "close" the ModalPopup, but I was wondering if there are already functions built into the scriptlib for the ModalPopup that will allow me to open or show and close or hide it?  If so, how do I access those functions client side?  Are they documented anywhere?


Thanks in advance!

View Complete Post

More Related Resource Links

How do I stop ModalPopup from closing

I have a simple example of a ModalPopup with a panel that appears in the center of the ModalPopup and a couple of buttons in that panel. One of the buttons is a cancel and the other is an OK button. No matter how many other buttons that I add each one closes the ModalPopup. I need to keep the ModalPopup open so that I can run a few calculations then click a close button.  Any help is appreciated.

Javascript Alert after closing a modalpopup



I have a linkbutton 'Forgot Password?' in my login page. On click of the link button  a modal popup will open . In that user has to give his username.

If the username doesnot exists  i want to show an alert 'Usename doesnot ' exists. 

Since the checking for the existenance of the username is on click of the button submit which is inside the modal popup, i can show the alert using the code

Page.ClientScript.RegisterStartupScript(...) . But I want something different

I want to call the javascript function after the maodal popup extender is closed

Please help me.



Open ModalPopup dialog on page load


Is there a way to make a modal popup panel active on page load so that the user can't do anything until they deal with the popup dialog?

Test Run: Test automation with Windows XP Embedded


This month's column explores how to create lightweight but powerful UI test automation for software systems that run on Windows XP Embedded.

Dr. James McCaffrey and Mike Hall

MSDN Magazine October 2007

Mobilize: Explore The New Features In Windows Embedded CE 6.0


Paul Yao presents an overview of Windows Embedded CE 6.0.

Paul Yao

MSDN Magazine December 2006

Pocket PC: MSMQ for Windows CE Brings Advanced Windows Messaging to Embedded Devices


Handheld devices are becoming increasingly important nodes on wireless networks, allowing their users to connect to data stores and other central server applications over the network. But wireless network connections can be unreliable, requiring the use of store-and-forward messaging that does not need to maintain a continuous connection. Microsoft Message Queue (MSMQ) has supplied these features to desktop machines, and there is now a version for handheld devices. MSMQ for Windows CE allows users of embedded devices to perform tasks such as remote order processing and inventory update without worrying about the state of their connection. The benefits of MSMQ for Windows CE and how to install and run the service is covered here.

Bob Hartman

MSDN Magazine December 2001

Windows CE: eMbedded Visual Tools 3.0 Provide a Flexible and Robust Development Environment


This article provides an overview of writing applications for Windows CE 3.0. Unicode support in Windows CE, the kernel, memory management, the object store, and COM and DCOM are discussed. The article also covers the user interface, graphics, the Internet, and how Windows CE compares to the desktop in each of these areas. eMbedded Visual Tools 3.0 is discussed in depth. To help the reader decide which tools to use, development with Visual Basic, Win32, MFC, and ATL are explained. Text editor samples with this article have been developed with Visual Basic and Win32 so their implementations can be compared.

Paul Yao

MSDN Magazine January 2001

Pocket PC: Migrating a GPS App from the Desktop to eMbedded Visual Basic 3.0


A Global Positioning System (GPS) device captures lots of interesting information that can be used in many ways. This article presents a custom application built with Visual Basic that collects data from a GPS satellite and charts the course of a user relative to the satellite. Such an application is obviously well suited for use on a handheld PC and porting the original application to eMbedded Visual Basic for Windows CE is described. The differences between Visual Basic and eMbedded Visual Basic, such as support for specific control and data types, are explained. Tips for dealing with reduced screen real estate on a handheld PC, debugging, and running in an emulator are also discussed.

Joshua Trupin

MSDN Magazine January 2001

ModalPopup/UpdatePanel from codebehind, inconsistent behavior onClick


First post bear with me please:

I have a simple form with a list of linkbuttons, each fires the same onclick event which sets an indicator image.  I have a dummy button with style="display:none" which I have set as the TargetControlID of the modal.

onClick event from the imagebutton, the modal is shown via modal.Show().  The cancel button inside the modalpopup fires an event which turns off the indicator image and hides the modal via modal.Hide(). 

The events fire perfectly, it's very simple!  Although after doing some testing I noticed the modalpopup is not presented after the 6-10th cycle of clicking the open event, then clicking cancel.  The grey background appears but it is behind the main panel and the modal is either presented behind this or is just simply not displaying. 

I spent hours researching various methods, implemented the CancelControlID to see if it was somehow tied to my call of modal.Hide() that fails.

This occurs with an updatepanel only.  The behaviour is much cleaner this way, so I would hope to be able to implement this.  I have basically eliminated everything but these two events!  Please help

Datalist with embedded Grid or List...Sub Totals issue with iteration


Let me see if one of you can assist with this one...


i have a similar situation, but mine does not use the selected item (item Command). Here is what the form is to do:


1. this is for an educational environment, so we use SID- NOT SSN's, but i use the SID as a filter in the subset as the grouping unique id.

2. I'm trying to inject a sub total row at the last line item of each SID (if more than one item in the report for that SID).

3. I'm looping thru the items in the Datalist Item Command with a for each (item i in Datalist2.Items).

Closing Javascript Modal dialog window after server side event processing


Hello Friends..

Please tell me how to close Javascript ModelDoalog Window.. after Server Side event Processing .

Basically i want close window in  finally Block After sucessfulll Updation.

AMit..... InnocentInnocentInnocentInnocentInnocentInnocentInnocent

JavaScript iframe resezing issue



I have an iframe that is supplied by another application, inside the iframe I have my .Net application. However, I am having sizing issues, where one minute that pages in the .Net fit the frame perfectly and the next minute they don't, with a vertical and horizontal scroll bars appearing. All the .Net Pages use a Master Page and I have also fixed the size of the pages, but with no luck. What I would was thinking if possible is to pass some javascript between the .Net application and the iframe which will make the pages and the iframe resize themselves. Has anyone done this before and have some code that I could use?

IE closing when user try to access the document library

<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> IE closing (crashing) when user try to access the document library in share point site.  here we are using WSS2.0.  this problem for not accursed all the users , this problem happening on some users. 

Check in dialogue does not show when closing word


In a document library that has check in and check out required a user on this network found that when they close word after editting a document, there isn't a dialogue asking whether a user wishes to check a document in.

This is how it normally works and without the dialogue there's all the likelyhood that many documents wont be checked in.

I did some testing and i found that the SharePoint drafts folder is located on a network drive. If i uncheck the box that says use local drafts folder on one of the dialogs that appear when openning a document then asks me if i want to check in the document when i close word, if i change the default location of the sharepoint drafts folder to a local folder then the dialog appears also. I can only assume there are some ACL's or File system atributes that tell word that the document needs to be checked in and those attributes are not read correctly if the document is on a network drive (perhaps ACL's are locked?).

You can change the default location with regedit or in one of the office programs so i was thinking that perhaps we could roll out a registry setting in the login script to default the sharepoint drafts folder to a local one, any other suggestions?

iframe and setfocus problem


I have a page with an iframe on it in which I load another page.
On this iframe page I have some textboxes above eachother.

When the first textbox is filled with a code the textchanged event is called 
and the code is checked with the database.
After the code has been changed to the right one (if needed) I want the 
focus to go to the next textbox.

So at the end of the event I do: Page.SetFocus(txtbox2)

But after the postback refresh, the focus is gone.
I have also put the control to be focussed in a session variable and then in the page_load event I set the focus to the control in the session variable, but still no focus on the textbox.
How can I put it on the 2nd textbox? 
all is done in the Iframe page codebehind.
I need this focus because the two textboxes are filled via bar code reader and after the scan an "enter press" is done automatically and to be able to allow two scans after each other this focus change is needed.

Do Post to Iframe in same page, and Password Field


Hi all,

I need do post of a form in my page to Iframe in the same page.

I set target in form tag.

<body onload="document.formuno.submit()">

                               <form name="formuno" method="post" action="http:\\externalCompany.WebForm.aspx" target="framename"  >

                                               <input type="hidden" name="prueba"  value="pruebatxt" runat="server">

<input type="hidden" name="prueba2"  value="pruebatxt" runat="server">

<input type="hidden" name="prueba3"  value="pruebatxt" runat="server">

<input type="hidden" name="password"  value="MY PASSWORD" runat="server">


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend