473,770 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ServiceNotifica tion or
DefaultDesktopO nly style to display a notification from a service
application.
Nov 21 '05 #1
6 11126
> 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 ServiceNotifica tion or
DefaultDesktopO nly style to display a notification from a service
application.


In server-side code, you can't.

On the client,

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

or

<script language="VBScr ipt">
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****@800mcma han.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 ServiceNotifica tion or
DefaultDesktopO nly 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.EventArg s) Handles MyBase.Load
If Not IsPostBack Then
Dim str As String = "<script language " & _
"=javascript>al ert('Click on the button?');</script>"
Page.RegisterSt artupScript("St artup", str)
End If
Me.Button1.Attr ibutes("onClick ") = _
"alert('I hope this helps a little bit?')"
End Sub
///

Cor
"rr****@800mcma han.com" <rr************ *****@discussio ns.microsoft.co m>
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 ServiceNotifica tion or
DefaultDesktopO nly 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************ *******@NOQUIER OSPAMportalvbNO SPAM.com.NOQUIE ROSPAM> wrote
in message news:56******** *************** ***********@mic rosoft.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****@800mcma han.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 ServiceNotifica tion or
DefaultDesktopO nly 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************ *******@NOQUIER OSPAMportalvbNO SPAM.com.NOQUIE ROSPAM> wrote
in message news:56******** *************** ***********@mic rosoft.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****@800mcma han.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 ServiceNotifica tion or
DefaultDesktopO nly 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.EventArg s) Handles MyBase.Load
If Not IsPostBack Then
Dim str As String = "<script language " & _
"=javascript>al ert('Click on the button?');</script>"
Page.RegisterSt artupScript("St artup", str)
End If
Me.Button1.Attr ibutes("onClick ") = _
"alert('I hope this helps a little bit?')"
End Sub
///

Cor
"rr****@800mcma han.com" <rr************ *****@discussio ns.microsoft.co m>
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 ServiceNotifica tion or
DefaultDesktopO nly style to display a notification from a service
application.


Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
31246
by: yezanxiong | last post by:
Hello all, I am new in asp.net developer,I would like to ask a simple question. how to display a message box in web application using asp.net? If I just use Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click MsgBox("please enter the correct user name and password",
10
4570
by: z | last post by:
I just installed Visual Studio .Net with Framework 1.1. I already had VB6 SP6 installed. I wanted to do a quick "hello world" example in VB.Net. The code is here: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim s As String Dim r As Long
9
3429
by: Ivan Jericevich | last post by:
In my code below at the line 'response' a blip sound is heard and the program exits the sub -- No MsgBox is displayed. What am I doing wrong? If nonNumberEntered = True Then msg = "Enter numbers only" style = MsgBoxStyle.OkOnly title = "ERROR in cast"
15
3166
by: cssExp | last post by:
hello, Rather than going on a wild explanation on what's the the problem, it'll be much quicker and easier if i let you look at it yourself, so I'll post my page source (actual contents taken out, of course). <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Language" content="en-us" />
1
4055
by: Ky_fanatic | last post by:
I am working on an application which returns data from multiple databases. The user enters a pallet ticket and it goes out to the multiple db's and returns data which meets the criteria. My application returns data when the user inputs a valid ticket number. If no records are returned it shows a blank data grid. Instead of the user seeing this blank datagrid I want to display a msgbox alerting the user no records were found with the...
13
3252
JodiPhillips
by: JodiPhillips | last post by:
G'day, I have a silly and simple problem that I need some guidance with. Due to the way our network is set up, I am unable to use the group permissions for Access and have had to implement log in procedures via a log in table within the database. This works fine. I have now expanded this table to include further data about the authorised user – Power User, Team Leader, & Facilitator. Depending on the user’s status as to which one of...
2
16683
by: smorrison64 | last post by:
I have a form that is coded to open a File Dialog boc to pick a picture to display on that particular item on a subform. My form is not based on query, but rather two separate tables (one primary, one sub). That code is working properly. How do I get that to translate to my report? I use VBA code because I use formats other than BMP for the pictures. Would basing the form on the qury that the report is based on solve the issue without...
4
1292
by: =?Utf-8?B?QmVu?= | last post by:
Hi all, I am trying to write a test console app in vb2008 express. Below is the code: Module Module1 Sub Main() Dim frm As New Form1 MsgBox("a test message") 'frm.Visible = True
2
6134
by: Plumebee | last post by:
Hi, I am very new to programming and have just started to use Visual Basic 2005 Express Edition. I am trying to read from a text file to draw a rectangles and lines. However to begin I'm trying to get the information to show in a listbox so that I know the application is reading the file correctly. I seem to be able to open the file but it doesn't display anything in the listbox. Dim FileName As String Dim reader As...
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.