@model IEnumerable<dmart.categorydetailsmaster>
<script src="~/Scripts/jquery-1.8.2.js"></script>
<script src="~/Scripts/jquery-1.8.2.min.js"></script>
@Html.DisplayNameFor(model => model.CategoryName)
@foreach (var item in Model)
{
}
<script type="text/javascript">
$(document).ready(function(){
$("[.treename] input[type=checkbox]").bind("click", function () {
var $this = $(this)
if($this.next().length > 0 && $this.next()[0].tagName == "DIV")
{
var isChecked = $(this).is(":checked");
if(isChecked)
{
$(this).attr("checked", "checked");
}
else {
$(this).removeAttr("checked");
}
}
});
});
</script>
you can use above code to start your tree view...