Click here to Skip to main content
15,896,606 members

Modal PopUp in separate iFrame

Motley Drew asked:

Open original thread
I have two iFrames in my web application. The first is a header that contains some buttons, the second is the main content window.

I am trying to click a button in iFrame1 and open a ModalPanel in iFrame2. I imagine others have run into this before. I realize iFrames are not always the best way to go, but I have a music player in my top frame, and I want to keep it playing while users navigate the site.

I'm basically looking for some type of Target attribute to reference iFrame2 as the target, but I'm not having any luck. I found a few hits regarding jQuery, but I have not learned jQuery yet, so I'm stuck with JavaScript, HTML & C# until then.

This is the button I'm using to open the model window in my header frame (iFrame1).

XML
<asp:ImageButton ID="plyrFilter" runat="server" ImageUrl="images/plyrFilter.gif" onmouseover="plyrToolTip('Filter Genre')" onmouseout="plyrToolTip('')" />


This is the model in my header frame (iFrame1).

XML
<!-- Popup Window for filter -->
        <asp:Panel ID="ModalPanel" runat="server" Width="300px">
        <div class="modalPopupWrapper">
            <div class="divCloseBtn"><asp:ImageButton ID="OKButton" runat="server" ImageUrl="~/images/modalClose.png" /></div>
            </div>

            <div class="divContent">
            This is some text. Put the filters in here.

             <asp:Button ID="btnLobtnFilter" runat="server" Text="Apply Filter" />

             </div>
        </asp:Panel>
        <ajaxToolkit:ModalPopupExtender ID="mpe" runat="server"  TargetControlId="plyrFilter" BackgroundCssClass="modalBackground"
        PopupControlID="ModalPanel" OkControlID="OKButton" />
    <!-- Popup Window for filter end -->


Of course this just opens the model window in the header iFrame. How can I get this to open in the main content iFrame (iFrame2)?
Tags: C#, Ajax, ASP.NET, IFrame

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900