473,465 Members | 1,366 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

messagebox in ASP.NET using VB.NET

how to show the message box in ASP.NET? I try MessageBox.Show, but not work.
Nov 17 '05 #1
2 6235
The MessageBox class is a class that displays a MessageBox on the machine on
which the app is running. An ASP.Net app runs on a server, but the user is
on another machine altogether, somewhere out there in the vast binary sea of
the Internet. There is no way that the MessageBox class can be of any use to
an ASP.Net app. to display a "Message Box" on the client browser, you would
use the JavaScript "alert()" method. This would have to be added to the HTML
of the page sent to the client. You could add such a script using
Page.RegisterStartupScript(). Example:

Dim strScript As String
strScript = "<script type=""text/javascript"">alert('Help! I am being held
captive by Wile E Coyote!')</script>"
If Not Page.IsStartupScriptRegistered("MyScript") Then
Page.RegisterStartupScript("MyScript", strScript)
End If

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Matthew Louden" <jr********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
how to show the message box in ASP.NET? I try MessageBox.Show, but not work.

Nov 17 '05 #2
The MessageBox class is a class that displays a MessageBox on the machine on
which the app is running. An ASP.Net app runs on a server, but the user is
on another machine altogether, somewhere out there in the vast binary sea of
the Internet. There is no way that the MessageBox class can be of any use to
an ASP.Net app. to display a "Message Box" on the client browser, you would
use the JavaScript "alert()" method. This would have to be added to the HTML
of the page sent to the client. You could add such a script using
Page.RegisterStartupScript(). Example:

Dim strScript As String
strScript = "<script type=""text/javascript"">alert('Help! I am being held
captive by Wile E Coyote!')</script>"
If Not Page.IsStartupScriptRegistered("MyScript") Then
Page.RegisterStartupScript("MyScript", strScript)
End If

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Matthew Louden" <jr********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
how to show the message box in ASP.NET? I try MessageBox.Show, but not work.

Nov 17 '05 #3

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

Similar topics

4
by: Drew Lettington | last post by:
I'm making a simple call to display error messages in a MessageBox from a Windows form and the MessageBox is not behaving in a modal fashion. My modal form displays, the user clicks a button and...
4
by: Gerry Viator | last post by:
Hi all, Whats going on. Testing messagebox, text isn't showing up. Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code "
8
by: Dennis C. Drumm | last post by:
I have ordered the book .NET Framework Solutions, In Search of the Lost Win32 API by John Paul Meuller which I think will help answer some of my questions I have regarding making custom...
2
by: Dennis C. Drumm | last post by:
This is a restatement of an earlier post that evidently wasn't clear. I am building a custom MessageBox dialog that has, among other things, a few new button options (yes to all, no to all, etc.)...
4
by: Tressa | last post by:
I have a messagebox that I only want to pop up only if it is not already being displayed on the screen. My code is still poping up the messagebox even though it is on the screen. What am I doing...
3
by: Sin | last post by:
I'm currently evaluating VC.NET as the new platform for the company I work for and things are looking grim... We're up against another IDE which took me about 5 minutes to master and I've been...
0
by: alex_f_il | last post by:
The class centers MessageBox inside the parent rectangle. Enjoy! using System; using System.Windows.Forms; using System.Text; using System.Drawing; using System.Runtime.InteropServices; ...
5
by: Robert Heuvel | last post by:
Hi, this is what I did: public struct SWaitCursor:IDisposable { public SWaitCursor (int i) { Cursor.Current = Cursors.WaitCursor; } void System.IDisposable.Dispose() { Cursor.Current =...
20
by: Peter E. Granger | last post by:
I'm having a strange problem (or at least it seems strange to me) trying to display a MessageBox in a VC++ .NET forms application. If I put the call to MessageBox::Show in the form's .h file, it...
3
by: Dan | last post by:
I am using Visual Studio .net 2003 (C#) I have a line of code like: messagebox.show("Hello"); I get the erorr message "The type or namespace name 'messagebox' could not be found (are you...
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:
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.