Reputation: 1879
Can anyone please tell me about how to show message box in MVC application. I don't want to use System.Windows.Forms.MessageBox. Additionaly i want to catch the response of button click e.g. If we press OK we should get a value. As it is in the case of System.Windows.Forms.MessageBox. Is there any way?
Thanks, Kaps
Upvotes: 2
Views: 5423
Reputation: 903
You should use javascript. There are a lot of options out there (jQueryUI, ExtJS,etc), the simplest one is using javascript built-in prompt box.
function prompt()
{
var name=prompt("Please enter your name:","Your name");
//do your logic
}
Upvotes: 0
Reputation: 1491
There is a function baked into JavaScript that you could use but it is pretty ugly and using something like the jQuery Dialog would probably be best. Here it is anyway:
var answer = confirm("Are you sure");
Upvotes: 2