2011-03-09 61 views
0
<%@ 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')); 
      }); 
     });  

    </script> 


     <div> 
     <asp:CheckBox ID="chkAll" runat="server" /> 
     <asp:CheckBox ID="CheckBox2" runat="server" /> 
    </div> 
+0

它notworking insidewebusercontrol ..但它在正常頁面工作正常likke Default.aspx – tatti1 2011-03-09 06:01:01

回答

1

可能控制ID被改變。嘗試

$('#<%=chkAll.ClientID%>')