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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to ASP

Status
Not open for further replies.

dpgrieve

MIS
Jul 25, 2004
4
US
I am having a problem getting an ASP response page, that is using VBSCRIPT, to work properly. I am new to asp web pages and it appears the problem might be with the <% and %> tags. What do these tags do?

Thanks [dazed]
 
these <% %> tags indicate that whatever code is in between them is executed on the server...

something like this:

<%
code
code
...
%>

by the way vbscript is a client side technology and asp is a server side technology

-VJ
 
I always get the "The page cannot be displayed" error when I submit from my form.

This is my form code:

<%@ LANGUAGE="VBSCRIPT" %>

<!--- This example illustrates the use of a "thank you" note after submitting a form --->

<HTML>
<HEAD>
<TITLE>Papa Rock Guestbook</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body,td,th {
color: #FFFF00;
}
body {
background-color: #000000;
}
-->
</style></HEAD>

<BODY>
<h1>Papa Rock's Guestbook</h1>
<BR>
<hr>
Please fill out the information below. This information will keep us informed about the people that have visited the site and will also help us compile a mailing list to send out our newsletter when it is available.
<P>
<FORM ACTION="aspty.asp" NAME="form" METHOD="post">

Name:
<INPUT TYPE="text" SIZE=30 NAME="yourname">
<P>
Email Address: <INPUT TYPE="text" SIZE=30 NAME="email">
<P>Have you ever seen Papa Rock perform live?
<INPUT TYPE="radio" NAME="seenlive" VALUE="yes" CHECKED>
Yes
<INPUT TYPE="radio" NAME="seenlive" VALUE="no">No

<P>
Are you interested in receiving Papa Rock's newsletter when it becomes available?
<INPUT TYPE="radio" NAME="nletter" VALUE="yes" CHECKED> Yes
<INPUT TYPE="radio" NAME="nletter" VALUE="no">No
<P>Comments :
<P>
<textarea name="email" cols="60" rows="5">Enter Comments Here...</textarea>

<P>
<INPUT name="Submit" TYPE="submit" VALUE="Submit">
<INPUT name="Reset" TYPE="reset" VALUE="Reset Form">
</FORM>

</BODY>
</HTML>

And THIS is my reponse page code:

<%@ LANGUAGE="VBSCRIPT" %>

<!--- This example illustrates the use of a "thank you" note after submitting a form --->

<HTML>
<HEAD>
<TITLE>ASP Guestbook Thank You</TITLE>
</HEAD>

<BODY>
Thanks for signing our guestbook, <% =Request.Form(yourname) %>.

<!-- The following area delineates and sends mail -->

<P>
<%

' Set up variables to hold the text strings
Dim DestinationEmail
Dim OriginatingEmail
Dim Subject
Dim Body


' assign text to the variable
OriginatingEmail = Request.form("email")
DestinationEmail = "dpgrieve@charter.net"
Subject = "Guestbook Reply"

' The body contains all the form data separated by semicolons
Body = "Name = " & Request.form("yourname") & "; Email Address = " & Request.form("email") & "; Seen Live = " & Request.form("seenlive"); & "News Letter = " & Request.form("nletter")

' Send email via the SendMail utility...note that this is an add-on to Active Server Pages and needs to be installed separatelly on the server.
Set email = Server.CreateObject("MPS.SendMail")
retCode = email.SendMail(OriginatingEmail, DestinationEmail, Subject, Body)

' Posts if mail has been sent or not
IF NOT True = retCode THEN
Response.write("Failed to send results to "&DestinationEmail&" due to "&Err.Description&".<P>")
ELSE
Response.write("Your information has been sent.<P>")
END IF

' Posts answer depending on radio button choice
IF Request.form("seenlive") = "yes" THEN
Response.write("Hope you liked us when you saw us. Please come see us again...")
ELSE
Response.write("You should come see us live at the Daiquiri Depot in Covington, Louisiana on Sundays.")
END IF
%>
</BODY>
</HTML>

 
Change this

<%@ LANGUAGE="VBSCRIPT" %>

to

this

<@ LANGUAGE="VBSCRIPT">


-VJ
 
amorous said:
by the way vbscript is a client side technology and asp is a server side technology

not 100% correct;

vbscript is a client-side language (supported only in Internet Explorer). It is also a server-side language used for ASP scripts along with JScript.

the <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> line is not strictly required for vbScript as it is the default language for ASP.

Is the Mail component referenced installed on the server ?



Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Err, still not 100% correct

VBScript is a scripting language for the Windows environment. The interpreter for the language was made available to browsers on the Windows platform so that you could write client-side VBScript. Same for IIS, the scripting interpreter was made available to IIS in order to use VBScript to manipulate the ASP objects and producse output. In the same manner you can also write ASP in a variety of other languages, such as JScript, PerlScript, and Python.


The part asking about the Mail component I would agree with though :) It is my guess that is what is causing the error.

If you aren't seeing more than "There was an error" as the error output page then go into the browser settings and turn off te "Show Friendly HTTP errors". If that doesn't cause you to see a more detailed error message, go to Advanced Settings > Internet Services Manager > Rt clik on your Default Web Server > Properties > Home Directory Tab > Configuration section hit the Settings button > Third tab in new popup window (App debugging?) > Select the radio button that says send detailed error messages.

Heh, i just did that from memory, goes to show even I can remember something if I do it enough times :p

[sub]01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111[/sub]
The never-completed website:
 
oh how many time have we/you walked end users through that so they can actually tell you whats wrong!!



Glen
Conception | Execution
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top