You cannot use
MessageBox
in ASP.NET, because you don't want to try to show a modal box on the server side. :-)
Using JavaScript
alert
is also usually not good; not only it is badly inflexible, but you cannot style it or make its look and behavior independent of the OS and particular browser; for production quality applications, this is not good enough.
For further explanation of the choice of the solution for the dialog-like behavior, please see my article
Modal Popup From Scratch.
It would be much better to develop modal-like behavior inside a Web page, and do it fully locally, with JavaScript. The first solution would be this:
https://jqueryui.com/dialog[
^].
Also, there are many 3rd-party jQuery plug-ins, collectively known as "modal popup", with different effects, such as transitions, and, notably, dimming of the rest of the page. Please see:
http://bfy.tw/AJH[
^].
If you need to learn jQuery, please see:
http://en.wikipedia.org/wiki/JQuery,
http://jquery.com,
http://learn.jquery.com,
http://learn.jquery.com/using-jquery-core,
http://learn.jquery.com/about-jquery/how-jquery-works (start from here).
The alternative would be the implementation of modal popup from scratch, which I explained in detail in my article referenced above.
—SA