I want to add/show some message with a OK button in c# asp.net without using the windows.forms name space.
-
Oh my, this is a big question. I think you need to read about how the web works. You cannot use c# to show a messagebox because the c# is running on the server and you want the messagebox to appear in the browser. There is no guarantee the users computer even has .Net installed. Instead you will likely use some form of javascript to show it.George Mauer– George Mauer2014-02-09 04:25:46 +00:00Commented Feb 9, 2014 at 4:25
-
@SimonWhitehead not alert()Shaivya Sharma– Shaivya Sharma2014-02-09 12:04:50 +00:00Commented Feb 9, 2014 at 12:04
Add a comment
|
3 Answers
Use:
string display = "Pop-up!";
ClientScript.RegisterStartupScript(this.GetType(), "yourMessage", "alert('" + display + "');", true);
how to show alert box after successful insert using C#
Buttons, Message Box, and Confirm Box in ASP.NET 3.5
2 Comments
Shaivya Sharma
Jefri thanks for the links! They helped a lot
Shaivya Sharma
Jefri I have tried the code form the link for Yes or No message box and it works. It shows the message with two buttons, Ok and Cancel. But I do not know how to capture OK or Cancel response in my c# code. Can you please help? Because I need to write c# code based on the response
Ext JS got some good message box scripts, check this out, it will help you Ext JS MessageBox Dialogs