I am using the code:
ClientScript.RegisterStartupScript(typeof(Page), "message", message);
This code works fine in an ASP.NET page but does not in a UserControl. I need to use this functionality in UserControl.
You could try:
string script = "<script language='JavaScript'>alert('hello');</script>";
Page.RegisterStartupScript("myscript", script);
or
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", "<script>alert('Hello.')</script>", false);