MessageBox question

  • Thread starter Thread starter roberto
  • Start date Start date
R

roberto

Hi at all
i have a web application (in vb.net), and i want to use a message box
control like System.Windows.Forms.MessageBox control, to show simple
messages . I used this but vb.net said
me an exception:

Imports System.Windows.Forms
'Dim msgBox As MessageBox
'msgBox.Show("User updating successful.", MessageBoxButtons.OK,
MessageBoxIcon.Information)

and the exception is

"Enum argument value 64 is not valid for buttons. buttons should be a value
from DialogResult."

I have think that exists a similar messagebox to web application, i was
looking for under System.Web.UI.WebControls but i didn't find it.
which is the class or control that do this?

thanks

roberto
 
Roberto,

There is no messagebox for a webpage.
See in this newsgroup a questionmessage from rroman, on 8 november
"How do you display a msgBox in a web application?"

He had exactly the same question as you and there are more answers on that
including mine.

I hope this helps/

Cor
 
roberto said:
i have a web application (in vb.net), and i want to use a message box
control like System.Windows.Forms.MessageBox control, to show simple
messages . I used this but vb.net said
me an exception:

Imports System.Windows.Forms
'Dim msgBox As MessageBox
'msgBox.Show("User updating successful.", MessageBoxButtons.OK,
MessageBoxIcon.Information)

'Show' is a shared method of 'MessageBox', so you can use 'MessageBox.Show'
directly.
I have think that exists a similar messagebox to web application, i was
looking for under System.Web.UI.WebControls but i didn't find it.
which is the class or control that do this?

No, there is no 'MessageBox' class. You'll have to use either a client-side
VBScript ('MsgBox') or a JScript ('alert').
 
Hi Roberto
The messageBox class show some windows Dll to show the message box that you
see . this is because when you develop a desktop application with vb.net .
it is also called "windows" application so it is build to run under windows
and it can use dll of windows . as for asp.net web application , they don't
execute much on the user side as most of the processing is done on the
server . you don't even know what is the OS that the user has .
I was just trying to give you an idea why you don't have MessageBox on the
asp.net classes. What you can do however is a small script that run on the
client side that would show the message in a message box . for example ,
there is a sample on this link
http://gnwda.org/tutorials/coding/java4.htm
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
Back
Top