Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

Message Box

Hi Experts,

   May I know how can I show a messsage box using ASP in a .asp file ?
   Hope it is not too difficult
0
seahpc
Asked:
seahpc
  • 4
  • 3
1 Solution
 
sybeCommented:
What do you mean with a "message box", something like can be done with javascript ?
0
 
seahpcAuthor Commented:
Javascript or VBScript will do .
cos I don't want to navigate to another page to show the error message .
If I do this, then When I navigate back, all my textfield will be empty and I need
to type in all over again just for a mistake I made earlier .

0
 
sybeCommented:
in javascript:

<script>
alert("this is a message")
</script>

Is this what you mean ?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
seahpcAuthor Commented:
Yes,

But How am I going to call it in the ASP Script ?
Let say

if index < 1 then
   ' Need to call the message box here
end if

<Script Language = "JavaScript">
alert("dffdg")
</Script>
0
 
sybeCommented:
1.
<% If index < 1 Then %>
   <script>
     alert("this is a message")
    </script>
<%End If%>

2.
<%
If Index < 1 Then
  Response.write "<script>alert('this is a message'):</script>"
End If
%>




%>



0
 
seahpcAuthor Commented:
er............ For your information,
my asp script is run at server. So if I use your codes,
it gives an error message nested Script .

Any other idea ?
0
 
sybeCommented:
Ah, I see, you use:

<SCRIPT RUNAT=SERVER>

</SCRIPT>

as your ASP scripting tags. Yep, then that is what happens.

Change those tags to:
<% and %>
And the problem is gone.

or do it like this:


.
..
If index < 1 Then
</SCRIPT>

<script>
 alert("this is a message")
</script>

<SCRIPT RUNAT=SERVER>
End If
..
.


You have to write the javascript code outside of the <SCRIPT RUNAT=SERVER> tags.
With <% %> you can write javascript code


0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now