Wrox Programmer Forums
|
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 15th, 2006, 03:55 PM
Authorized User
 
Join Date: Jul 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default calculator.asp

Hello How do I add my code to this without having to enter all 102 lines. thanks dls
 
Old August 15th, 2006, 04:02 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Heuh? Add code to what? What 102 lines?

Can you please specify a book version, chapter number and page number and elaborate a bit about the problem you're having?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 15th, 2006, 04:47 PM
Authorized User
 
Join Date: Jul 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi I went back and redid the chap 7 items in dreamweaver mx 2004. I finished the calculator.asp item on page 258. When I try f12 after putting the file, I get a page can't be displayed and it states that I have a 500.100 http, internal server error asp error iis. so I wanted to include the code for review. when i hit the # sign I get what looks like html in the page, like this - So my question is, what is the method for including the actual code without entering it as it's 102 lines. Or is it necessary to enter it and is it possible to just attach the file somehow. thanks dls
 
Old August 16th, 2006, 01:12 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You can simply copy and paste the code here.

For readability, please enclose it in code tags (with the # symbol you described) and add linebreaks to layout your code so the page doesn't get too wide. Use the Preview button to see how your post will end up.

The code you saw does indeed look like HTML, but is replaced with actual HTML when the page is viewed.

Also, try this:

1. Open Internet Explorer
2. Choose Tools | Options
3. Switch to the Advanced tab
4. Look for an option called Display Friendly HTTP Errors or something like that and make sure it's not selected.
5. Run your asp page again. You should get more details about the error.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 18th, 2006, 09:33 AM
Authorized User
 
Join Date: Jul 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Ian I unchecked http friendly messages, f12'ed the calculator asp and got a similar screen. code follows:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
 Dim dblResult
 Dim dblNumber1
 Dim dblNumber2
 If Request.Form("btnCalculate") <> "" Then
   dblNumber1 = CDbl(Request.Form("txtNumber1"))
   dblNumber2 = CDbl(Request.form("txtNumber2"))
   Select Case Request Request.form("1stOperator")
     Case "+"
     dblResult = dblNumber1 + dblNumber2
     Case "-"
     dblResult = dblNumber1 - dblNumber2
     Case "*"
     dblResult = dblNumber1 * dblNumber2
     Case "/"
     dblResult = dblNumber1 / dblNumber2
   End Select
   End If
   %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>GlobalSoccerEvents.com - Your Source for Soccer Events Around the Globe</title>

<style type="text/css">
<!--
td {
    font-family: Arial, Helvetica, sans-serif;
    color: #000000;
}
a {
    color: #669933;
}
-->
</style>
</head>

<body><table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="images/logo.gif" width="257" height="58"></td>
    <td><table width=" %" border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
    <td><a href="home.asp">Home</a></td>
    <td>&nbsp;&nbsp;&nbsp;</td>
    <td><a href="events.asp">Events</a></td>
    <td>&nbsp;&nbsp;&nbsp;</td>
    <td><a href="mySite.asp">My Site</a></td>
  </tr>
</table>
</td>
  </tr>
</table>
<br>
<script language="JavaScript" type="text/javascript">
 var sPageName = '<%=Request.ServerVariables("SCRIPT_NAME")%>';
 sPageName = sPageName.substr(sPageName.lastIndexOf('/') + 1).toLowerCase();
 sPageName = sPageName.substr(0, sPageName.lastIndexOf('.'));
 if (document.getElementById(sPageName))
 {
 document.getElementById(sPageName).style.fontweigh t = 'Bold';
 document.getElementById(sPageName).style.fontsize = '14pt';
 }
 </script>

 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><h2>Calculator</h2></td>
  </tr>
  <tr>
    <td><form action="calculator.asp" method="post" name="frmCalculator"><table width=" %" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><input name="txtNumber1" type="text" value="<%=dblNumber1%>"></td>
    <td><select name="1stOperator" id="1stOperator">
      <option value="+">+</option>
      <option value="-">-</option>
      <option value="*">*</option>
      <option value="/">/</option>
    </select></td>
    <td><input name="txtNumber2" type="text" value="<%=dblNumber2%>"></td>
    <td><input name="btnCalculate" type="submit" value="Calculate"></td>
  </tr>
  <tr>
    <td colspan="4">The outcome is:<%= dblResult %> </td>
    </tr>
</table>
</form></td>
  </tr>
  <tr>
    <td align="center"><br>
    <br>
    <br>
    <br>
    <br>
    Footer here</td>
  </tr>
</table>
</body>
</html>

Any help will be greatly appreciated. dls
 
Old August 18th, 2006, 09:49 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Weird. You're supposed to get something like this:
Code:
Microsoft VBScript compilation error '800a03ea' 

Syntax error 

/calculator.asp, line 10 

Case "+"
You could try opening the site in FireFox as it shows more error detail by default. Without a detailed error page, debugging code will be pretty difficult.

Anyway, look at this:

Select Case Request Request.form("1stOperator")

This should be:

Select Case Request.Form("1stOperator")

I also noticed you're using 1stOperator with a 1 (one) and not an l (el). Right now, this is not a problem, because you also named the drop downlist 1stOperator.

However, you may run into this with other examples, so if you find you get errors, check out your 1 vs l usage...

Cheers,

P.S. Ian??

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 18th, 2006, 10:37 AM
Authorized User
 
Join Date: Jul 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Ian, I will try it. But how did you know I was wierd. I thought I had kept that a secret. dls
 
Old August 18th, 2006, 10:46 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Ian?? ;)

Weird...

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 18th, 2006, 10:47 AM
Authorized User
 
Join Date: Jul 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi again I deleted the first "Request" in the line 10 and now everything works fine. thanks again
 
Old August 18th, 2006, 11:14 AM
Authorized User
 
Join Date: Jul 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I told you. I realized I had your name screwed up just after I sent the last one. feel free to call me betty or brenda. Your name and picture is on the book so sorry, my fault. never again, i painted imar on the inside of my eyelids. dls






Similar Threads
Thread Thread Starter Forum Replies Last Post
calculator mojtaba rashidi Visual Studio 2005 0 March 17th, 2008 07:29 AM
Dreamweaver - TheSoccerSite - Calculator.asp zhengfengyang Dreamweaver (all versions) 5 March 21st, 2006 03:25 AM
Calculator DweeLer Other Programming Languages 1 November 18th, 2005 08:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.