Home > DeveloperSection > Forums > How to show/display message box in C# asp.net forms?
Takeshi Okada
Takeshi Okada

Total Post:89

Points:629
Posted on    December-19-2014 10:34 PM

 ASP.Net C# 
Ratings:


 2 Reply(s)
 672  View(s)
Rate this:

I want to add/show some message with a OK button in c# asp.net without using the windows.forms name space.



ezra heywood
ezra heywood

Total Post:145

Points:1019
Posted on    December-20-2014 5:45 AM

Use:

 

string display = "Pop-up!";

            ClientScript.RegisterStartupScript(this.GetType(), "yourMessage", "alert('" + display + "');", true);


Kamlakar Singh
Kamlakar Singh

Total Post:28

Points:196
Posted on    December-20-2014 6:29 AM

One easy solution is to register some JavaScript code in your page:

 

string script = "alert(\"Hello!\");";

ScriptManager.RegisterStartupScript(this, GetType(),ServerControlScript", script, true);


Don't want to miss updates? Please click the below button!

Follow MindStick