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

  • Home
  • SEARCH
  • 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 8901037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:14:58+00:00 2026-06-15T01:14:58+00:00

I am hoping that someone can help shed some light on this issue I’ve

  • 0

I am hoping that someone can help shed some light on this issue I’ve been struggling over for the last couple of days. I have been using the AJAX Toolkit ModalPopupExtender outside of ListViews perfectly fine, but for some reason I can’t seem to wrap my head around why this code is not working inside of a ListView item template.

Basically, what I am trying to achive is: a user is presented with some rows of data via the ListView in which each row displays a LinkButton with the text “Remove”. I want the user to be able to click on this link, and a modal dialog box pop up and ask them if they are sure they want to do this. If they click the okay button, it should fire off an event and do the necessary database work and reload the page… if not, cancel the postback request and clear the dialog box.

With the code below, I have successuflly hooked into the link button via the targetid property of the ModalPopupExtender so the dialog does popup. However, the okay button does not fire off the event I’ve written (I’ve placed a breakpoint in the codebehind within the event, and it does not get touched). Also, the cancel button does not work as it normally would outside of the listview control.

I must be missing something fairly fundamental here, but I’m at a loss – any help would greatly be appreciated. I’m certainly open to alternative methods if this just isn’t viable.

<ItemTemplate>
        <tr>
            <td align="center">
                <asp:Label runat="server" ID="lblUserID" Text='<%# Eval("USERID") %>' Visible="false" />
                <asp:LinkButton runat="server" ID="lnkRemoveUser" Text="Remove" /> 

                <asp:Panel ID="removeUserModalPanel" runat="server">
                    <div class="popup">
                        <div class="loginTitleBar" id="Div1">
                            Remove User
                        </div>
                        <div class="popupBody">
                            <p>
                                Are you sure you want to remove this user?
                            </p>
                        </div>
                        <div class="popupControls">
                            <asp:Button id="btnRemoveUserOkay" runat="server" type="button" Text="Remove User" 
                                onclick="btnRemoveUserOkay_Click" />
                            <input id="btnRemoveUserCancel" type="button" value="Cancel" />
                        </div>
                    </div>
                </asp:Panel>

                <asp:ModalPopupExtender 
                    ID="removeUserModalPopupExtender" 
                    runat="server"
                    BackgroundCssClass="ModalPopupBG"
                    CancelControlID="btnRemoveUserCancel"
                    TargetControlID="lnkRemoveUser"
                    PopupControlID="removeUserModalPanel"
                    drag="false" >
                </asp:ModalPopupExtender>
            </td>
            <td>
                <asp:LinkButton ID="lnkUserName" runat="server" Text='<%# Eval("USERNAME") %>' />
            </td>
            <td>
                <asp:Label ID="lblFirstName" runat="server" Text='<%# Eval("FIRSTNAME") %>' />
            </td>
            <td>
                <asp:Label ID="lblLastName" runat="server" Text='<%# Eval("LASTNAME") %>' />
            </td>
            <td>
                <asp:Label ID="lblEmailAddress" runat="server" Text='<%# Eval("EMAILADDRESS") %>' />
            </td>
        </tr>
    </ItemTemplate>
  • 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-06-15T01:15:01+00:00Added an answer on June 15, 2026 at 1:15 am

    Finally I can make this works. It’s a little tricky though. Here are the steps:

    1. Move the panel, the button close and the modalpopupextender outside the listview
    2. Create a HiddenField or whatever control and associate this with the TargetControlID of the ModalPopupExtender control.
    3. In the button on the ListView handle the Click event, and in the code behind call directly to the ModalPopupExtender.Show() method, and voilá.

    It is a little dirty indeed, but the ModalPopupExtender seems to override the click event of the listview button when it’s associated with the control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am hoping that someone can help shed some light on the underlying issue
I'm hoping that someone can help me with this issue. I've been racking my
I have a really wierd issue that I'm hoping someone can shed some light
hoping someone can help shed some light on this for me. Im working on
Hi There I am hoping that someone can help me with this php issue.
Hoping someone can help me out here, been struggling with this for a little
I was hoping that someone can help me with this fancybox plugin issue. Problem
I am hoping that someone can shed some light on how .NET handles garbage
Hoping that someone can help clear up this very annoying situation I find myself
I have an issue that is driving me nuts and hoping someone can help.

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.