Jaqen H'ghar
Jaqen H'ghar

Reputation: 1879

How to show Message box in MVC application

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

Answers (3)

Anton Setiawan
Anton Setiawan

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

David Radcliffe
David Radcliffe

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

Jack
Jack

Reputation: 141

use jquery dialog: http://jqueryui.com/demos/dialog/

Upvotes: 1

Related Questions