Hi,
I've been trying to do a messagebox in a controller in asp.net mvc, but every time I type MessageBox or MsgBox it doesn't give me the option to import a namespace...
What can I use that would be similar to a MessageBox?
Hi,
I've been trying to do a messagebox in a controller in asp.net mvc, but every time I type MessageBox or MsgBox it doesn't give me the option to import a namespace...
What can I use that would be similar to a MessageBox?
the MessageBox functionality is provided by the System.Windows library which is not available in the ASP.NET MVC context, since your site is running within a browser.
Instead, you should use a javascript library to show a message box.
You could use the following in order to display a message box
alert('Hi there')you could render out a script tag as a actionresult that has
alert('{0}'); where the placeholder is you message
Message box can be shown using Javascript, you can write your own HtmlHelper for this or have a partial which takes the message as input and diplays it, in this way you can reuse your partial
I suggest using the jQuery UI dialog. It's incredibly easy to use, very powerful, and really easy to style.