Check/UnCheck CheckBox Control in ASP.Net

How to Check/UnCheck CheckBox Control in ASP.Net using JQuery.

First, Download JQuery library from http://jquery.com. and include in web page at head section.

Design the ASP.Net web form with two Button and one CheckBox control.

Here, we have two asp.net button control one for Check and second for Uncheck CheckBox control in asp.net.

The Design of web page is :

Check/UnCheck CheckBox Control in asp.net using JQuery.
Check/UnCheck CheckBox Control in asp.net using JQuery.

Write below JQuery code at head section in aspx page.

<head runat=”server”>
<title>JQuery in ASP.Net</title>
<script src=”jquery-1.4.3.min.js” type=”text/javascript”></script>
<script>
$(document).ready(function() {
$(“#Button1”).click(function() {
$(‘#<%=CheckBox1.ClientID%>’).attr(‘checked’, true);
});
$(“#Button2”).click(function() {
$(‘#<%=CheckBox1.ClientID%>’).attr(‘checked’, false);
});

});
</script>
</head>

Check/UnCheck CheckBox Control in asp.net using JQuery.
Check/UnCheck CheckBox Control in asp.net using JQuery.
Check/UnCheck CheckBox Control in asp.net using JQuery.
Check/UnCheck CheckBox Control in asp.net using JQuery.

Leave a Reply

Your email address will not be published. Required fields are marked *