I am using the below code but it is not working....where am i going wrong? Also please let me know how to collect the response given by the user..
Page page = HttpContext.Current.CurrentHandler as Page;
if (page != null && !page.ClientScript.IsClientScriptBlockRegistered("alert"))
page.ClientScript.RegisterClientScriptBlock(typeof(MyPage), "alert", script);