ASP.NET: JavaScript MessageBox (alert) aufrufen

// JavaScript MessageBox (alert) aufrufen
public static void ShowAlert(string msg)
{
  string script = String.Format("Achtung: {0}", msg);

  Page page = HttpContext.Current.CurrentHandler as Page;
  page.ClientScript.RegisterStartupScript(typeof(Page), "alert", script);
}

ASP.NET JavaScript

November 2007 | Permalink | Feedback