开发者

How to use this jquery inside webusercontrol?

开发者 https://www.devze.com 2023-02-15 12:46 出处:网络
<%@ Control Language=\"VB\" AutoEventWireup=\"false\" CodeFile=\"WebUserControl.ascx.vb\" Inherits=\"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%>')
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号