OnCheckedChanged
is a Server side event. So you are not allowed to give the javascript function here.
You need to register the javascript from the server or use
input type="CheckBox" and remove runat=server totally.
<asp:CheckBox OnCheckedChanged="checkchanged" runat="server" AutoPostBack=true/>
protected void checkchanged(object sender, EventArgs e)
{
this.ClientScript.RegisterStartupScript(this.GetType(), "registerscript", "alert('hi');", true);
}
Hence you can see the postback produces the alert.