By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,626 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,626 IT Pros & Developers. It's quick & easy.

How do you display a msgBox in a web application?

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
> 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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.