473,387 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dumb question about Message boxes

I'm using MS .Net Version 7, using VB .Net working on a "simple" web page.
All I want to do is display a messagebox. I tried using Messagebox.Show,
and get an error that Messagebox has not been declared. I tried using
MsgBox (like we used in VB 6) but this throws application errors every time
I run it I get the error "It is in valid to show a modal or form when the
application is not running in UserInteractive mode. Specify the
ServiceNotification or DefaultDesktopOnly style to display a notice from a
service application" I tried Response.Write, which just puts the message in
the background of my web page, not popping up like a REAL MsgBox! Please
help with this, this should be SIMPLE!!! TIA

Coleen

Jul 21 '05 #1
9 1700
It seems that you are talking about Web app. Do you really want to show a
MessageBox on the web server, while user sits in front of a web browser
thousands kilometers away? How does the user know a MessageBox pops up on
the web server? In Web app, if you want to nitify user something, you should
have the web server send back a page to user, either in the same browser
window or in a new browser window.

By the way, MessageBox is in System.Windows.Forms namespace, which is not
referenced in web app by default. That is why you get error "Not declared".
"Coleen" <co**********@yahoo.com> wrote in message
news:OC*************@TK2MSFTNGP11.phx.gbl...
I'm using MS .Net Version 7, using VB .Net working on a "simple" web page.
All I want to do is display a messagebox. I tried using Messagebox.Show,
and get an error that Messagebox has not been declared. I tried using
MsgBox (like we used in VB 6) but this throws application errors every time I run it I get the error "It is in valid to show a modal or form when the
application is not running in UserInteractive mode. Specify the
ServiceNotification or DefaultDesktopOnly style to display a notice from a service application" I tried Response.Write, which just puts the message in the background of my web page, not popping up like a REAL MsgBox! Please
help with this, this should be SIMPLE!!! TIA

Coleen

Jul 21 '05 #2
What I am doing is writing validation for a Web form. If data is entered
incorrectly, I want a messagebox to notify the user the data type is
incorrect...I tried putting in the Name Space for System.Window, but that
did not work either. Ugh! This used to be simple! thanks for any/all of
your help.
"Norman Yuan" <no********@RemoveThis.shaw.ca> wrote in message
news:ccszb.549386$6C4.180063@pd7tw1no...
It seems that you are talking about Web app. Do you really want to show a
MessageBox on the web server, while user sits in front of a web browser
thousands kilometers away? How does the user know a MessageBox pops up on
the web server? In Web app, if you want to nitify user something, you should have the web server send back a page to user, either in the same browser
window or in a new browser window.

By the way, MessageBox is in System.Windows.Forms namespace, which is not
referenced in web app by default. That is why you get error "Not declared".

"Coleen" <co**********@yahoo.com> wrote in message
news:OC*************@TK2MSFTNGP11.phx.gbl...
I'm using MS .Net Version 7, using VB .Net working on a "simple" web page. All I want to do is display a messagebox. I tried using Messagebox.Show, and get an error that Messagebox has not been declared. I tried using
MsgBox (like we used in VB 6) but this throws application errors every time
I run it I get the error "It is in valid to show a modal or form when the application is not running in UserInteractive mode. Specify the
ServiceNotification or DefaultDesktopOnly style to display a notice from a
service application" I tried Response.Write, which just puts the
message in
the background of my web page, not popping up like a REAL MsgBox!

Please help with this, this should be SIMPLE!!! TIA

Coleen


Jul 21 '05 #3
When I put System.Windows.Forms in the Namespace I get the blue squiggly
line with the message "Namespace or type 'forms' for the Imports
'System.Windows.forms' cannot be found. What's up with that? Usually, when
you put in the Namespace, the choices pop-up after you type the . but in
this case, Windows does not come up as one of the available choices under
System! How can I put in a Namespace when it is not available or supported?

"Norman Yuan" <no********@RemoveThis.shaw.ca> wrote in message
news:ccszb.549386$6C4.180063@pd7tw1no...
It seems that you are talking about Web app. Do you really want to show a
MessageBox on the web server, while user sits in front of a web browser
thousands kilometers away? How does the user know a MessageBox pops up on
the web server? In Web app, if you want to nitify user something, you should have the web server send back a page to user, either in the same browser
window or in a new browser window.

By the way, MessageBox is in System.Windows.Forms namespace, which is not
referenced in web app by default. That is why you get error "Not declared".

"Coleen" <co**********@yahoo.com> wrote in message
news:OC*************@TK2MSFTNGP11.phx.gbl...
I'm using MS .Net Version 7, using VB .Net working on a "simple" web page. All I want to do is display a messagebox. I tried using Messagebox.Show, and get an error that Messagebox has not been declared. I tried using
MsgBox (like we used in VB 6) but this throws application errors every time
I run it I get the error "It is in valid to show a modal or form when the application is not running in UserInteractive mode. Specify the
ServiceNotification or DefaultDesktopOnly style to display a notice from a
service application" I tried Response.Write, which just puts the
message in
the background of my web page, not popping up like a REAL MsgBox!

Please help with this, this should be SIMPLE!!! TIA

Coleen


Jul 21 '05 #4
If you are writing a web application (e.g. Webform), then the System.Windows
namespace is not available. This namespace is meant for WindowsForms
applications.

Jan
"Coleen" <co**********@yahoo.com> schreef in bericht
news:uk**************@TK2MSFTNGP12.phx.gbl...
When I put System.Windows.Forms in the Namespace I get the blue squiggly
line with the message "Namespace or type 'forms' for the Imports
'System.Windows.forms' cannot be found. What's up with that? Usually, when you put in the Namespace, the choices pop-up after you type the . but in
this case, Windows does not come up as one of the available choices under
System! How can I put in a Namespace when it is not available or supported?
"Norman Yuan" <no********@RemoveThis.shaw.ca> wrote in message
news:ccszb.549386$6C4.180063@pd7tw1no...
It seems that you are talking about Web app. Do you really want to show a
MessageBox on the web server, while user sits in front of a web browser
thousands kilometers away? How does the user know a MessageBox pops up on the web server? In Web app, if you want to nitify user something, you

should
have the web server send back a page to user, either in the same browser
window or in a new browser window.

By the way, MessageBox is in System.Windows.Forms namespace, which is not referenced in web app by default. That is why you get error "Not

declared".


"Coleen" <co**********@yahoo.com> wrote in message
news:OC*************@TK2MSFTNGP11.phx.gbl...
I'm using MS .Net Version 7, using VB .Net working on a "simple" web

page. All I want to do is display a messagebox. I tried using Messagebox.Show, and get an error that Messagebox has not been declared. I tried using
MsgBox (like we used in VB 6) but this throws application errors every

time
I run it I get the error "It is in valid to show a modal or form when the application is not running in UserInteractive mode. Specify the
ServiceNotification or DefaultDesktopOnly style to display a notice from
a
service application" I tried Response.Write, which just puts the

message
in
the background of my web page, not popping up like a REAL MsgBox!

Please help with this, this should be SIMPLE!!! TIA

Coleen



Jul 21 '05 #5
"Coleen" <co**********@yahoo.com> wrote in
news:uk**************@TK2MSFTNGP12.phx.gbl:
When I put System.Windows.Forms in the Namespace I get the blue
squiggly line with the message "Namespace or type 'forms' for the
Imports 'System.Windows.forms' cannot be found. What's up with that?
Usually, when you put in the Namespace, the choices pop-up after you
type the . but in this case, Windows does not come up as one of the
available choices under System! How can I put in a Namespace when it
is not available or supported?


Adding a "using" or "Imports" statement at the top of the code file is not
the same as ading a reference. To add a reference use the project
explorer. Right-click on the "references" folder as select "Add
reference..." Then browse for "System.Windows.Forms".

When you create a "Windows Forms Application" in the new project wizard it
does this or you. On the other hand you should not be using windows forms
in a web application, which is why that reference is not made.

What you want is a scripting message box. It will appear on the client
side of the web page. I have not made one in ASP.NET, but it won't be that
different from ASP.

See the following link. It shows how to do it with both Javascript and
vbscript:

http://www.javascriptkit.com/javatutors/vbalert.shtml

Michael Lang
Jul 21 '05 #6
Thank you! I was just informed by one of my co-workers that I would need to
do my form validation using JavaScript - unfortunately I have NO knowledge
of JavaScript, so this is good news that I can do it in VB Script! Thanks
:-)

"Michael Lang" <ml@nospam.com> wrote in message
news:Xn*******************************@207.46.248. 16...
"Coleen" <co**********@yahoo.com> wrote in
news:uk**************@TK2MSFTNGP12.phx.gbl:
When I put System.Windows.Forms in the Namespace I get the blue
squiggly line with the message "Namespace or type 'forms' for the
Imports 'System.Windows.forms' cannot be found. What's up with that?
Usually, when you put in the Namespace, the choices pop-up after you
type the . but in this case, Windows does not come up as one of the
available choices under System! How can I put in a Namespace when it
is not available or supported?
Adding a "using" or "Imports" statement at the top of the code file is not
the same as ading a reference. To add a reference use the project
explorer. Right-click on the "references" folder as select "Add
reference..." Then browse for "System.Windows.Forms".

When you create a "Windows Forms Application" in the new project wizard it
does this or you. On the other hand you should not be using windows forms
in a web application, which is why that reference is not made.

What you want is a scripting message box. It will appear on the client
side of the web page. I have not made one in ASP.NET, but it won't be

that different from ASP.

See the following link. It shows how to do it with both Javascript and
vbscript:

http://www.javascriptkit.com/javatutors/vbalert.shtml

Michael Lang

Jul 21 '05 #7
But you really shouldn't do it in VBScript, since Netscape browsers don't
support VBScript.

In a nutshell Colleen, it wasn't that different in Classic ASP. You
couldn't ask for a msgbox() in classic ASP either because message boxes are
not produced by the server, they are produced by the browser. Since
server-side code executes, well at the server, asking for a messagebox is
out of the question. All requests for messageboxes/alerts must be made at
the client level.
"Coleen" <co**********@yahoo.com> wrote in message
news:OL**************@TK2MSFTNGP11.phx.gbl...
Thank you! I was just informed by one of my co-workers that I would need to do my form validation using JavaScript - unfortunately I have NO knowledge
of JavaScript, so this is good news that I can do it in VB Script! Thanks
:-)

"Michael Lang" <ml@nospam.com> wrote in message
news:Xn*******************************@207.46.248. 16...
"Coleen" <co**********@yahoo.com> wrote in
news:uk**************@TK2MSFTNGP12.phx.gbl:
When I put System.Windows.Forms in the Namespace I get the blue
squiggly line with the message "Namespace or type 'forms' for the
Imports 'System.Windows.forms' cannot be found. What's up with that?
Usually, when you put in the Namespace, the choices pop-up after you
type the . but in this case, Windows does not come up as one of the
available choices under System! How can I put in a Namespace when it
is not available or supported?


Adding a "using" or "Imports" statement at the top of the code file is not the same as ading a reference. To add a reference use the project
explorer. Right-click on the "references" folder as select "Add
reference..." Then browse for "System.Windows.Forms".

When you create a "Windows Forms Application" in the new project wizard it does this or you. On the other hand you should not be using windows forms in a web application, which is why that reference is not made.

What you want is a scripting message box. It will appear on the client
side of the web page. I have not made one in ASP.NET, but it won't be

that
different from ASP.

See the following link. It shows how to do it with both Javascript and
vbscript:

http://www.javascriptkit.com/javatutors/vbalert.shtml

Michael Lang


Jul 21 '05 #8
Which is fine and dandy, if you know JavaScript, but I don't! So I am
looking for an alternative. If I have to use JavaScript, then I have to,
but do you have any suggestions for a VERY beginner? I have no idea even
where to start. Where do I write the code? In the aspx portion, or the
code behind? I haven't a clue... Thanks for any suggestions :-)

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:Oc**************@TK2MSFTNGP10.phx.gbl...
But you really shouldn't do it in VBScript, since Netscape browsers don't
support VBScript.

In a nutshell Colleen, it wasn't that different in Classic ASP. You
couldn't ask for a msgbox() in classic ASP either because message boxes are not produced by the server, they are produced by the browser. Since
server-side code executes, well at the server, asking for a messagebox is
out of the question. All requests for messageboxes/alerts must be made at
the client level.
"Coleen" <co**********@yahoo.com> wrote in message
news:OL**************@TK2MSFTNGP11.phx.gbl...
Thank you! I was just informed by one of my co-workers that I would need
to
do my form validation using JavaScript - unfortunately I have NO knowledge of JavaScript, so this is good news that I can do it in VB Script! Thanks :-)

"Michael Lang" <ml@nospam.com> wrote in message
news:Xn*******************************@207.46.248. 16...
"Coleen" <co**********@yahoo.com> wrote in
news:uk**************@TK2MSFTNGP12.phx.gbl:

> When I put System.Windows.Forms in the Namespace I get the blue
> squiggly line with the message "Namespace or type 'forms' for the
> Imports 'System.Windows.forms' cannot be found. What's up with that? > Usually, when you put in the Namespace, the choices pop-up after you
> type the . but in this case, Windows does not come up as one of the
> available choices under System! How can I put in a Namespace when it > is not available or supported?

Adding a "using" or "Imports" statement at the top of the code file is
not the same as ading a reference. To add a reference use the project
explorer. Right-click on the "references" folder as select "Add
reference..." Then browse for "System.Windows.Forms".

When you create a "Windows Forms Application" in the new project wizard it
does this or you. On the other hand you should not be using windows forms in a web application, which is why that reference is not made.

What you want is a scripting message box. It will appear on the

client side of the web page. I have not made one in ASP.NET, but it won't be

that
different from ASP.

See the following link. It shows how to do it with both Javascript and vbscript:

http://www.javascriptkit.com/javatutors/vbalert.shtml

Michael Lang



Jul 21 '05 #9
See my other post...

JavaScript IS the answer you are looking for. In today's world of web
development, JavaScript is a must know.
"Coleen" <co**********@yahoo.com> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
Which is fine and dandy, if you know JavaScript, but I don't! So I am
looking for an alternative. If I have to use JavaScript, then I have to,
but do you have any suggestions for a VERY beginner? I have no idea even
where to start. Where do I write the code? In the aspx portion, or the
code behind? I haven't a clue... Thanks for any suggestions :-)

"Scott M." <s-***@BADSPAMsnet.net> wrote in message
news:Oc**************@TK2MSFTNGP10.phx.gbl...
But you really shouldn't do it in VBScript, since Netscape browsers don't
support VBScript.

In a nutshell Colleen, it wasn't that different in Classic ASP. You
couldn't ask for a msgbox() in classic ASP either because message boxes

are
not produced by the server, they are produced by the browser. Since
server-side code executes, well at the server, asking for a messagebox is out of the question. All requests for messageboxes/alerts must be made at the client level.
"Coleen" <co**********@yahoo.com> wrote in message
news:OL**************@TK2MSFTNGP11.phx.gbl...
Thank you! I was just informed by one of my co-workers that I would need
to
do my form validation using JavaScript - unfortunately I have NO

knowledge of JavaScript, so this is good news that I can do it in VB Script! Thanks :-)

"Michael Lang" <ml@nospam.com> wrote in message
news:Xn*******************************@207.46.248. 16...
> "Coleen" <co**********@yahoo.com> wrote in
> news:uk**************@TK2MSFTNGP12.phx.gbl:
>
> > When I put System.Windows.Forms in the Namespace I get the blue
> > squiggly line with the message "Namespace or type 'forms' for the
> > Imports 'System.Windows.forms' cannot be found. What's up with that? > > Usually, when you put in the Namespace, the choices pop-up after you > > type the . but in this case, Windows does not come up as one of the > > available choices under System! How can I put in a Namespace when it > > is not available or supported?
>
> Adding a "using" or "Imports" statement at the top of the code file is not
> the same as ading a reference. To add a reference use the project
> explorer. Right-click on the "references" folder as select "Add
> reference..." Then browse for "System.Windows.Forms".
>
> When you create a "Windows Forms Application" in the new project wizard
it
> does this or you. On the other hand you should not be using windows

forms
> in a web application, which is why that reference is not made.
>
> What you want is a scripting message box. It will appear on the

client > side of the web page. I have not made one in ASP.NET, but it won't
be that
> different from ASP.
>
> See the following link. It shows how to do it with both Javascript

and > vbscript:
>
> http://www.javascriptkit.com/javatutors/vbalert.shtml
>
> Michael Lang



Jul 21 '05 #10

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

Similar topics

1
by: Coleen | last post by:
I have a multiline text box that I only want to allow the user to type 500 characters in. I set the maxlength to 500, but I can type more than 500 characters in it. Is there a way to set the max...
2
by: Marion | last post by:
I would like to go on record to say that I think not having the Printer collection in .Net is dumb. The only help tells me that I should use the Print Dialog. Well, I don't want to. Programming is...
11
by: dhnriverside | last post by:
Hi peeps Ok, so I thought I'd have a go at making a console app in VS2k5... I haven't written any windows apps for years, let alone dos apps (been web programming) and I've hit a dumb error... ...
10
by: Edward | last post by:
I've just taken over maintaining a system from a colleague who has left. I find the following line in her code: Dim params(2) As SqlClient.SqlParameter params(0) = New...
4
by: Stelrad Doulton | last post by:
Hi, Apologies if this isn't the correct forum. I am writing a communication solution (actually on the Compact Framework) based on HttpWebRequests hooking up with custom handlers on the...
9
by: Coleen | last post by:
I'm using MS .Net Version 7, using VB .Net working on a "simple" web page. All I want to do is display a messagebox. I tried using Messagebox.Show, and get an error that Messagebox has not been...
16
by: CMM | last post by:
Is it me or has anyone noticed that F1 is really dumb in VS2005. Since VB3 I have been able to click F1 on an ambiguous method in code and the IDE automatically determines the type based on the...
8
by: Keith Rebello | last post by:
I have a program whose main form has a picture box on which concrete column sections are drawn. Input to the drawing is achieved by filling in data in various dialog boxes (called by using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.