CheckBox

(ASP.NET MVC)


Hi,
In this article i explain the asp.net mvc checkbox

Views

@{
    ViewBag.Title = "CheckboxExample";
}

<h2>CheckboxExample</h2>

@Html.CheckBox("chck_color",false)


<script type="text/javascript">
    //using jquery
    $(function () {

        $('#chck_color').click(function () {

            if ($(this).is(':checked')) {
                alert('checked');
                //write your code
            }
            else {
                alert('unchecked');
                //write your code
            }
        });

    });
</script>



Image

Ratings


Average Rating: 5.00 by 1 users
Giri Prasad
6/28/2013
6/28/2013
Download PDF

Comments