?
Solved

using jquery loaded usercontrol codebehind

Posted on 2014-09-21
2
Medium Priority
?
226 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
Suggested Courses

765 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