tags:

views:

224

answers:

2
+1  Q: 

ASP Messagebox

I am new to code and starting with ASP. How do I create a simple message box so I can alert the users on the web page?

Thanks

Henry

A: 

Here is one way of doing it:

<%
message = "This is my message"
Response.Write("<script language=VBScript>MsgBox """ + message + """</script>") 
%>
Jason Heine
This worked great. Thanks!
How many browsers support VBScript?
AnthonyWJones
@AnthonyWJones, Very true, I agree, TheTXI has a better solution using javascript.
Jason Heine
+4  A: 
<% response.write("<script language=""javascript"">alert('Hello!');</script>") %>
TheTXI
This worked great. Thanks! I am going to stay away from Javascript for a while and stay with the ASP VBScript for now. I appreciate your feed back!
If that is how you wish to do it, but I would suggest rethinking your stance on JavaScript just because you'll probably end up using it much much more down the line. Also, there are many many more JavaScript resources and tutorials out there.
TheTXI
+1 as the javascript will work in browsers other than IE too...
ChristopheD