Solved

Message Box

Posted on 1998-07-16
7
202 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
  • 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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 40 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now