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 8101343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:57:32+00:00 2026-06-05T22:57:32+00:00

I have an UpdatePanel which I am using to replace the content inside of

  • 0

I have an UpdatePanel which I am using to replace the content inside of the page. Outside of the UpdatePanel I have some jQuery using the on() function to assign some button clicks. From my understanding the new jQuery.on() syntax is meant to replace both event handlers and the old live() functionality. The live() function was supposed to monitor changes to the page and attach events to any element added to the page, yet this does not happen with the on() function in my test pages. If I open up the console and run the same function after the UpdatePanel has changed then the event handler works correctly.

Here is what I have javascript wise:

$(function () {
    $('.results').on('click', function () {
        $(this).children('.explination').slideToggle();
    });
});

The UpdatePanel is a simple UpdatePanel with a MultiView in it.

I am aware that I can use the Microsoft Ajax PageRequestManager to handle this but it seems like it should be unnecessary if the events bound like I believe they are supposed to. I will use it for now, but I am curious whether I am doing it incorrectly or whether jQuery and ASP.Net are not working together.

One theory I have is that, for whatever reason, the UpdatePanel is some how not firing the DOM update triggers that jQuery is using to capture changes and fire off the on event again.

  • 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-05T22:57:33+00:00Added an answer on June 5, 2026 at 10:57 pm

    The trick is to use delegated events. Quoting from jQuery documentation:

    Delegated events have the advantage that they can process events from descendant elements that are added to the document at a later time. By picking an element that is guaranteed to be present at the time the delegated event handler is attached, you can use delegated events to avoid the need to frequently attach and remove event handlers.

    To use delegated events pass the selector as the second parameter, something like:

    $('html').on('click', '.results', function () {
        $(this).children('.explination').slideToggle();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page which loads children pages by using jQuery's .load function... My
I have an updatepanel which after clicking one button is submitting the page. The
I have an UpdatePanel which has a Repeater inside it, and inside of the
I have a page which contains an ASP UpdatePanel, and within the UpdatePanel, there
I have several dropdownlists and textboxes inside an <asp:UpdatePanel> , which should let me
I have an UpdatePanel and in my updatepanel_Load I have some code which looks
In my child page i have an imageButton, which is surrounded by the UpdatePanel.
I have a panel on an aspx page which contains an UpdatePanel. This panel
I have created a nice tooltip box using JQuery and I used some plugin
I have a issue with Jquery Modal dialog being called from a button inside

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.