Solved

using jquery loaded usercontrol codebehind

Posted on 2014-09-21
2
225 Views
Last Modified: 2014-09-21
We use the jquery to load a usercontrol using page webmethod. It works. But the controls inside the usercontrol do not fire events anymore.
0
Comment
Question by:Deraldo Silva
[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
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 40335521
instead using (for example) :
$("#<%= Button.ClientID %>").click(function() {
use :
$(document).on("click", "#<%= Button.ClientID %>", function() { // since jQuery 1.9
or :
$("#<%= Button.ClientID %>").live("click",  function() { // before jQuery 1.9

more info :
http://api.jquery.com/on/#direct-and-delegated-events
Event handlers are bound only to the currently selected elements; they must exist on the page at the time your code makes the call to .on()....delegated events have the advantage that they can process events from descendant elements that are added to the document at a later time.

http://api.jquery.com/on/
http://api.jquery.com/live/
0
 

Author Closing Comment

by:Deraldo Silva
ID: 40335764
thx. I got it.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 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