ASP.NET TidbiTIP #1

HOWTO: Push a javascript alert using server side code

protected virtual void MessageBox(string message)
{
     RegisterStartupScript(
                           
System.Guid.NewGuid().ToString(),
                           
string.Format("<script language='javascript'>alert('{0}');</script>", message));
}

No Comments