This code also performs the same functionality:
<script type="text/javascript">
window.onload = function() {
var check = document.getElementById("<%=checkbox1.ClientID %>");
check.onchange = function() {
if (this.checked == true)
document.getElementById("<%=textbox1.ClientID %>").disabled = false;
else
document.getElementById("<%=textbox1.ClientID %>").disabled = true;
};
};
</script>
<asp:checkbox checked="false" id="checkbox1" runat="server" />
<asp:textbox id="textbox1" enabled="false" text="Test" runat="server" />