Solved

AJax Modal Popup Extender

Posted on 2010-11-27
7
904 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

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!

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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