?
Solved

AJax Modal Popup Extender

Posted on 2010-11-27
7
Medium Priority
?
915 Views
Last Modified: 2012-05-10
Does anyone have some sample code of opening an Ajax Modal Popup Extender by clicking a Link Button?  I have tried so many samples and I can't get any of them to work.   I am up against a deadline, so if you have some sample code that is working, I would greatly appreciate it.



0
Comment
Question by:sherbug1015
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 9

Expert Comment

by:TonyReba
ID: 34223796
What error are you getting?  Are you assigning a behavior id to the popup extender, for example...
<asp:LinkButton runat="server" ID="btnHiddenCompanyEmployeeController" />
<ajax:ModalPopupExtender BackgroundCssClass="modalBackground" ID="popUpCompanyEmployee"
  runat="server" PopupControlID="panelCompanyEmployee"
  TargetControlID="btnHiddenCompanyEmployeeController" BehaviorID="popUpCompanyEmployeeBehavior">

...and call up the show function using the behavior id, for example...

<asp:HyperLink runat="server" ID="HyperLink1" NavigateUrl="javascript:$find('popUpCompanyEmployeeBehavior').show();" Text="New Employee" />

Open in new window

0
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 34224261
here is the css

.modalBackground {
      background-color:Gray;
      filter:alpha(opacity=70);
      opacity:0.7;
}

.modalPopup {
      background-color:#ffffdd;
      border-width:3px;
      border-style:solid;
      border-color:Gray;
      padding:3px;
      width:250px;
}
<tr>
                    <td style="width: 100%; vertical-align: middle" colspan="2" align="center">
                        <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="modalBackground"
                                CacheDynamicResults="false" DropShadow="false" Enabled="true" EnableViewState="true"
                                TargetControlID="btnPreview" PopupControlID="PnlSelectCountry" PopupDragHandleControlID="PnlMove"
                                CancelControlID="btnExit">
                                                               
                        </cc1:ModalPopupExtender>
                    <asp:Panel ID="PnlSelectCountry" runat="server" Style="display: none">
                                <table style="font-size: 8pt; font-family: tahoma; background-color: white;">
                                    <tr>
                                        <td class="FormPopUPModel" colspan="2">
                                            <asp:Panel ID="PnlMove" runat="server" Style="cursor: move;">
                                                <table width="100%" border="0">
                                                    <tr>
                                                        <td align="right">
                                                            <asp:Button ID="btnExit" runat="server" CssClass="button" Text="close" ToolTip="close" />
                                                        </td>
                                                    </tr>
                                                      <tr>
                                                        <td align="right">
                                                       
                                                       <table width="100%">
                                                                    <tr>
                                                                         <td align="center" style="width: 10%;">
                                                                <asp:Button Height="20px" Style="display: none;" ID="Button1" Width="75px" CssClass="button"
                                                                    runat="server" Text="preview" />
                                                                <asp:Label ID="lblKeywords" runat="server" CssClass="FieldName" ToolTip="Key Search">Number:</asp:Label>
                                                            </td>
                                                            <td style="width: 20%;">
                                                                <asp:TextBox ID="txtKeywords" runat="server" CssClass="textbox_m" Height="16px" MaxLength="40"></asp:TextBox>
                                                                  </td>
                                                                        <td>
                                                                            <asp:Button ID="btnKeySearch" runat="server" CssClass="button" Font-Names="Tahoma"
                                                                                Height="20px"  
                                                                                Text="search" Width="75px" ToolTip="Search" />
                                                                        </td>
                                                                        <td>
                                                                           
                                                                        </td>
                                                                    </tr>
                                                                </table>
                                                       
                                                         </td>
                                                    </tr>
                                                    <tr>
                                                    <td align="center">
                                                  some text
                                                    
                                                    </td>
                                                    </tr>
                                                </table>
                                                
                                            </asp:Panel>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                    </td>
                    </tr>

Open in new window

0
 

Author Comment

by:sherbug1015
ID: 34225401
TonyReba - Your script does not work either.  Just using what you provided I get an error
Exception Details: System.InvalidOperationException: The control with ID 'popUpCompanyEmployee' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.

Does this require a ScriptManager control?  If so, how is this done.  


 TestPopUp.txt
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:sherbug1015
ID: 34225449
king2002 - Your code has too much missing.  None of your CSSclasses are available and there are other problems.  Do you have something I can use out of the box?
0
 
LVL 9

Accepted Solution

by:
TonyReba earned 2000 total points
ID: 34225666
Yes if you are using vs2008-2010. Drag and drop the ajax tool kit script manager control  anywhere in your page. That should get rid of that error
0
 

Author Comment

by:sherbug1015
ID: 34226047
TonyReba.  Thanks.  That worked fine.
0
 

Author Closing Comment

by:sherbug1015
ID: 34226049
Thanks.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses how to implement server side field validation and display customized error messages to the client.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question