When you use update panel then you can not call javascript like above. You have to use
ScriptManager.RegisterStartupScript
Just change your
ClientScript.RegisterStartupScript(this.GetType(), "", "alert('Cannot Delete')", true);
to
ScriptManager.RegisterStartupScript(updatePanelId,updatePanelId.GetType()
,"('Cannot Delete')", javaScript, true);