Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Get ASP to run code at ASP load stage

Status
Not open for further replies.

HebieBug

Programmer
Jan 8, 2001
354
JP
Am using VBSCRIPT in my ASP code and would like it so that when the ASP page loads it runs the code before it displays the HTML segment
Just as an example how can I get it to show the message box before loading
<HTML>
<% msgbox &quot;Test me
DO SOME OTHER STUFF
%>
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot;>
<meta name=&quot;GENERATOR&quot; content=&quot;Microsoft FrontPage 4.0&quot;>
<meta name=&quot;ProgId&quot; content=&quot;FrontPage.Editor.Document&quot;>
<title>New Page 1</title>
</head>

<body>

</body>

</html>
 
If you want to do a client-side message box, you should use javascript.

<%
MsgBox 'something'
%>

will not get processed by the client. I *think* this will popup a message box on the server (since everything between <% %> tags are processed on the server).

Use javascript, and put it at between your head tags.

ex:
<script language=&quot;javascript&quot;>
alert(&quot;This is my message&quot;);
</script>

there are a bunch of good javascript tutorials on the web... those will help you out a whole lot more than my tiny example :)

hth
leo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top