View Full Version : Message Box in ASP.Net

10-12-2003, 05:25 PM
Would anybody tell me how to use a message box in ASP.Net applicatin properly?

In my web form I have -

Imports System.Windows.Forms
and then somewhere in the code
MessageBox.Show("Text", "Title", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button3, MessageBoxOptions.ServiceNotification)

and this line and all following is never executed. What is wrong?


10-12-2003, 07:18 PM
for aSP NET it is better to use a javascrip

youLink.attributes.add("onClick" , "myAlert")

and your Javascript

window.alert("the text you like");

10-12-2003, 08:08 PM
thx angiras, you helped again!

10-13-2003, 03:03 AM
Just to add to angiras' comment - VbScript should never be used client-side, unless you only want your website to work with Internet Explorer, and nothing else.

I always use JavaScript for client-side coding. Always. :)