Hi Maha i have Tried this and Got Working.,
JavaScript:
<script type="text/javascript">
function handleChange(cb) {
var btn = document.getElementById('ButtonTest');
if (cb.checked == true) {
btn.disabled = true;
alert('Checked True');
return true;
} else {
alert('False');
btn.disabled = false;
return false;
}
}
</script>
ASPX Page Code:
<div>
<asp:CheckBox runat="server" ID="checkMe" title="Hey Check Me" name="Check Me" ClientIDMode="Static" onclick="handleChange(this)" AutoPostBack="false" Text="Check Me" />
<asp:Button runat="server" ID="ButtonTest" title="Hey Check Me" ClientIDMode="Static" Text="Submit Button" OnClick="ButtonTest_Click" />
</div>
Code Behind:
protected void ButtonTest_Click(object sender, EventArgs e)
{
// Your Logic
}
But the Check Box AutoPostBack="false"
should be in false. Other wise the Entire page will be reloaded and disabled will attribute will removed.
Hope it may helpful., :)