A simple way to show a popup window (2)

Last time I show how to popup a window if your website supports AJAX, and this time I am going to show you how to do the same thing if your website doesn't support AJAX.

public static void ShowMessage(Page page, string text)
{
  Literal oLiteral = new Literal();
  oLiteral.Text = "<script>alert('" + text + "')</script>";
  page.Controls.Add(oLiteral);
}
Here is how to use:
protected void btnSave_Click(object sender, EventArgs e)
{
ShowMessage(this, "Success!");
}

0 Comments:

Random Posts

Powered by Stuff-a-Blog