Created
December 15, 2016 08:40
-
-
Save Phuseos/4c822f3d57d0706355b21f71b822305b to your computer and use it in GitHub Desktop.
CreateMessage (ASP / C#)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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