messagebox in ASP.NET using VB.NET

  • Thread starter Thread starter Matthew Louden
  • Start date Start date
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.
 
Back
Top