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 *

1 + 9 =


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">