Solved

AJax Modal Popup Extender

Posted on 2010-11-27
7
908 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
Independent Software Vendors: 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 500 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

728 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