Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "key", "alert('hi');", true);
Now if you are using UpdatePanel then replace you above code with following code.
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "key", "alert('hi');", true);
Now you can see the alert saying 'hi' to you!!