instead of
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Fill all the necessary information.');", true);
try this:
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "Alert", "alert('Fill all the necessary information.')", true);
or debug your control using breakpoint.