469,290 Members | 1,866 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

How do you display a msgBox in a web application?

I've tried the good old fashioned msgBox but I get:

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.
Nov 21 '05 #1
6 10879
> I've tried the good old fashioned msgBox but I get:

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.


In server-side code, you can't.

On the client,

<script language="JavaScript">
<!--
alert("Your message here");
-->
</script>

or

<script language="VBScript">
MsgBox "Your Message Here"
</script>

But note that some browsers don't like VB Script.
--
Peace & happy computing,

Mike Labosh, MCSD
"I have no choice but to believe in free will."
Nov 21 '05 #2
Hi,

you have to use JavaScript or VBScript to show a MessageBox in Web apps.

However and If you undertand Spanish, there is a very good article in MSDN
Spanish, wrote by another MVP, that teach as put and use MessageBox in Web
apps.

The URL of this article is:
http://www.microsoft.com/spanish/msd...ces/art120.asp

I hope that helps.

Kind Regards,

Jorge Serrano
MVP VB.NET

"rr****@800mcmahan.com" wrote:
I've tried the good old fashioned msgBox but I get:

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.

Nov 21 '05 #3
Roman,

Maybe this can help you as well?

Private Sub Page_Load(ByVal sender As _
System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim str As String = "<script language " & _
"=javascript>alert('Click on the button?');</script>"
Page.RegisterStartupScript("Startup", str)
End If
Me.Button1.Attributes("onClick") = _
"alert('I hope this helps a little bit?')"
End Sub
///

Cor
"rr****@800mcmahan.com" <rr*****************@discussions.microsoft.com>
I've tried the good old fashioned msgBox but I get:

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.

Nov 21 '05 #4
Flag the Espanola, Scott Mitchell a borne and bred genius always has very well written articles on
this kind of subject. Check him out at 4 Guys from Rolla or here in this MSDN feature article.

http://msdn.microsoft.com/asp.net/us...SideScript.asp

hth
Richard
"Jorge Serrano [MVP VB]" <NO*******************@NOQUIEROSPAMportalvbNOSPAM. com.NOQUIEROSPAM> wrote
in message news:56**********************************@microsof t.com...
Hi,

you have to use JavaScript or VBScript to show a MessageBox in Web apps.

However and If you undertand Spanish, there is a very good article in MSDN
Spanish, wrote by another MVP, that teach as put and use MessageBox in Web
apps.

The URL of this article is:
http://www.microsoft.com/spanish/msd...ces/art120.asp

I hope that helps.

Kind Regards,

Jorge Serrano
MVP VB.NET

"rr****@800mcmahan.com" wrote:
I've tried the good old fashioned msgBox but I get:

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.

Nov 21 '05 #5
Thanks Richard!

I like the Scott articles and contributions very much.
I didn't know about this.

Thanks a lot!

Jorge
"Richard Myers" wrote:
Flag the Espanola, Scott Mitchell a borne and bred genius always has very well written articles on
this kind of subject. Check him out at 4 Guys from Rolla or here in this MSDN feature article.

http://msdn.microsoft.com/asp.net/us...SideScript.asp

hth
Richard
"Jorge Serrano [MVP VB]" <NO*******************@NOQUIEROSPAMportalvbNOSPAM. com.NOQUIEROSPAM> wrote
in message news:56**********************************@microsof t.com...
Hi,

you have to use JavaScript or VBScript to show a MessageBox in Web apps.

However and If you undertand Spanish, there is a very good article in MSDN
Spanish, wrote by another MVP, that teach as put and use MessageBox in Web
apps.

The URL of this article is:
http://www.microsoft.com/spanish/msd...ces/art120.asp

I hope that helps.

Kind Regards,

Jorge Serrano
MVP VB.NET

"rr****@800mcmahan.com" wrote:
I've tried the good old fashioned msgBox but I get:

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.


Nov 21 '05 #6
You guys have been great. Thanks again.

"Cor Ligthert" wrote:
Roman,

Maybe this can help you as well?

Private Sub Page_Load(ByVal sender As _
System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Dim str As String = "<script language " & _
"=javascript>alert('Click on the button?');</script>"
Page.RegisterStartupScript("Startup", str)
End If
Me.Button1.Attributes("onClick") = _
"alert('I hope this helps a little bit?')"
End Sub
///

Cor
"rr****@800mcmahan.com" <rr*****************@discussions.microsoft.com>
I've tried the good old fashioned msgBox but I get:

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.


Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Ivan Jericevich | last post: by
4 posts views Thread by =?Utf-8?B?QmVu?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.