Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6979373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:52:43+00:00 2026-05-27T17:52:43+00:00

I am having trouble with the AJAX ModalPopupExtender control. What I am trying to

  • 0

I am having trouble with the AJAX ModalPopupExtender control. What I am trying to do is click a button, trigger a postcode lookup using Yahoo API with the button click event, display this in an asp panel in the ShowModalDialog box, and then close the dialog. I also need a separate button on the page to submit information using a form that is completely separate from this.

I have set the target button up as follows:

<asp:Button ID="btnStockist" runat="server" BackColor="#2C3473" OnClick="btnStockist_Click" />

The modalpopup is as follows:

<ajax:ModalPopupExtender ID="mpeStockist" runat="server" okcontrolid="btnOkay" targetcontrolid="btnStockist" popupcontrolid="pnlDisplay" 
                            popupdraghandlecontrolid="PopupHeader" drag="true" backgroundcssclass="ModalPopupBG" ></ajax:ModalPopupExtender> 

What is actually happening is that when clicking the target button, the popup opens but the event does not trigger (no postcode lookup is done). However, clicking the separate, unrelated button on the same page DOES trigger the event, and the lookup works perfectly. I am able to close the dialog as normal. I have tried hiding the target button with CSS as a quick workaround, but the problem is that any other buttons on the page seem to trigger the lookup method and modalpopup no matter what their click event is programmed to do, and I need them to work separately.

In case it’s of any use, the panel code is here:

<asp:Panel ID="pnlDisplay" style="display:none" runat="server">
                <div class="PopupContainer">
                    <div class="PopupBody">                        
                        <div align="center">Local Suppliers</div>
                        <br /><br />
                        <asp:label ID="lblError" runat="server"></asp:label>
                        <asp:UpdatePanel ID="upAlternatives" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                            <asp:DataList ID="dlStockist_Select" runat="server">
                                <HeaderTemplate>
                                    <table cellpadding="5" width="680">
                                        <tr>
                                            <td>Name</td>
                                            <td>Address</td>
                                            <td>Town/City</td>
                                            <td>Miles (Approx)</td>                                                                        
                                        </tr>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td><%# DataBinder.Eval(Container.DataItem, "CNAM") %></td>
                                        <td><%# DataBinder.Eval(Container.DataItem, "CADD1") %></td>
                                        <td><%# DataBinder.Eval(Container.DataItem, "CADD3")%></td>                                
                                        <td align="center"><%# DataBinder.Eval(Container.DataItem, "Distance")%></td>                          
                                    </tr>
                                </ItemTemplate>
                                <FooterTemplate>
                                    </table>            
                                </FooterTemplate>
                            </asp:DataList>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                        <asp:LinkButton ID="btnOkay" runat="server" visible="true" Text="Close" CommandName="Update" BorderColor="#FFFFFF" BackColor="#000000" 
                            BorderWidth="3" BorderStyle="Double" ForeColor="White" Font-Size="13pt" style="cursor: pointer; padding: 1px 15px 1px 15px; 
                            margin-top: 10px;" Font-Underline="False"></asp:LinkButton> 
                    </div>
                </div>
            </asp:Panel>

Thanks in advance for the help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:52:44+00:00Added an answer on May 27, 2026 at 5:52 pm

    Add one more button as per below

    <asp:Button Text="targetbutton" ID="tgtbtn" runat="server" Style="display: none" />
    

    Set id of this button in targetcontrolid of modulpopup (because it can not be null)

    and in click event of btnStockist

    open your modulapopup by code

    protected void btnStockist_Click(object sender, EventArgs e)
    {
       mpeStockist.Show();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having trouble trying to post data correctly using jQuery/AJAX I have the following...
Having trouble getting success from this... <!-- Ajax --> <script type=text/javascript> $('a.clickup').click(function (event) {
Ok, so I'm using Jquery's AJAX function and it's having trouble passing a URL
I'm having some trouble with an Ajax script which disables my jQuery click events.
Im having trouble with my jquery. Im using ajax to log me in to
I'm having trouble updating the DOM when doing an AJAX post using JQuery. This
I'm having trouble getting the correct scope within prototype's Ajax.Request class. What I'm trying
I'm having trouble returning data from my controller using an ajax post function. What
I am having trouble with client side validation when using Ajax and jQuery to
I'm trying to port an existing AJAX app to Flex, and having trouble with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.