use this :-
public static void MessageBox(System.Web.UI.Page senderPage, string alertMsg, string alertKey)
{
string strScript = "<script language=JavaScript>alert('" +alertMsg + "')</script>";
if (!(senderPage.IsStartupScriptRegistered(alertKey)))
senderPage.RegisterStartupScript(alertKey, strScript);
}
and call from aspx.cs with Three parameter
try this.