Skip to content

Instantly share code, notes, and snippets.

@Phuseos
Created December 15, 2016 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Phuseos/4c822f3d57d0706355b21f71b822305b to your computer and use it in GitHub Desktop.
Save Phuseos/4c822f3d57d0706355b21f71b822305b to your computer and use it in GitHub Desktop.
CreateMessage (ASP / C#)
using System;
using System.Web.UI;
public partial class CreateAMessage : Page
{
protected void Page_Load(object sender, EventArgs e)
{
//This page creates an example messagebox on load.
CreateMessage("Hello world!");
}
//The code below creates the message. The code is a piece of JavaScript that creates the Alert pop-up, with the message provided in Page_Load.
void CreateMessage(string Message) => ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AlertBox", "alert('" + Message + "');", true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment