MessageBoxes are produced by the client. Because you are making a web
application, this means the browser. Your code, however, will run on the
server. This is why you can't use a MessageBox from server-side code in a
web app (always been that way).
You could substitute:
response.write("alert(yourMessageHere)")
for your MsgBox() line.
Also, in situations where you can use the MessageBox (Windows Applications),
you should now use the MessageBox class, rather than the MsgBox() function
from VB 6. The class is used with its shared "show" method as:
MessageBox.Show(args)
-Scott M.
"Larry Pits" <lp***@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi All,
I just want to display a message using msgbox() and I keep on getting this
error message.
It is invalid to show a modal dialog or form when the application is not
running in UserInteractive mode. Specify the ServiceNotification or
DefaultDesktopOnly style to display a notification from a service
application.
This error came from test.aspx.vb
Private Sub Img_OK_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles Img_OK.Click
If txt_Username.Text = "ABC" Then
Msgbox("Hello")
End If
End Sub
Why is wrong with this line? TIA