messagebox in ASP.NET using VB.NET

M

Matthew Louden

how to show the message box in ASP.NET? I try MessageBox.Show, but not work.
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top