How to use this jquery inside webusercontrol?
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="WebUserControl.ascx.vb" Inherits="WebUserControl" %>
<script src="scripts/jquery-1.5.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#chkAll').click(
function() {
$("INPUT[type='checkbox']").attr('checked', $('#chkAll').is(':checked'));
});
});
开发者_JS百科 </script>
<div>
<asp:CheckBox ID="chkAll" runat="server" />
<asp:CheckBox ID="CheckBox2" runat="server" />
</div>
Probably control ID is changed. Try
$('#<%=chkAll.ClientID%>')
精彩评论