I want that when i check or uncheck the checkbox state,accordingly in label text is changed.
If i check the checkbox,then in label text is checked else unchecked.
protected void Page_Load(object sender, EventArgs e)
{
CheckBox1.Attributes.Add("oncheckedchanged", "javascript: return CheckboxState");
}
<script language ="javascript" type ="text/javascript">
function CheckboxState()
{
var checkbox=document.getElementById("CheckBox1");
var lbl=document.getElementById ("Label1");
alert(checkbox.checked);
lbl.innertext=checkbox.checked;
return false;
}
</script>
But when i check or uncheck,firstly page is postbacked & secondly,in label nothing is coming..