?
Solved

Message Box

Posted on 1998-07-16
7
Medium Priority
?
250 Views
Last Modified: 2010-04-09
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
Comment
Question by:seahpc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 1844674
What do you mean with a "message box", something like can be done with javascript ?
0
 
LVL 2

Author Comment

by:seahpc
ID: 1844675
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
 
LVL 28

Expert Comment

by:sybe
ID: 1844676
in javascript:

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

Is this what you mean ?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Author Comment

by:seahpc
ID: 1844677
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
 
LVL 28

Accepted Solution

by:
sybe earned 160 total points
ID: 1844678
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
 
LVL 2

Author Comment

by:seahpc
ID: 1844679
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
 
LVL 28

Expert Comment

by:sybe
ID: 1844680
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question