I'm having an issue using JQuery within an ASP.NET website. I want to bind a common click handler to multiple similar elements (generated through a ListView for those familiar with ASP.NET). My assumption was to use a class selector as follows (as an example):
$('.standard-group').click(function () {
alert($(this).attr("id"));
});
This relates back to a series of divs having this class:
<div class="standard-group">
some content
</div>
<div class="standard-group">
some other content
</div>
Furthermore, the content is generated inside a ContentPlaceholder and merged into a master page (2 nested master pages actually). I've tried putting the click handler between <script></script> tags inside a second ContentPlaceholder that injects it's content into the <head> section of the page, tried putting it with the content in the main ContentPlaceholder all to no avail. What ends up happening is that the generated page loads correctly and I can inspect the source and see the function there, but no event is raised. I suspect it's something to do with the master page/server processing scenario, but can't pinpoint it.
Any help out there?