SolutionCottage.com
Posted  27 Mar 2009 - 01:53:31

Category: JavaScript


JQuery select server controls ASP.net

Issue:
You want to add a selector to a control that on runtime gets another name, because it's in a master page for example. It might a name something similar to ctl00_myDiv.

Solution:
Use this syntax for selecting the object:

$(document).ready(function() {
var paragraph = $('#' + '<%=paragraph.ClientID%>');
paragraph.click(function() {
paragraph.html("bajs");
});
});



Marked as helpful by 9 users




0 comments:








© SolutionCottage 2008-2011 7/26/2017 1:43:09 AM