Wrox Programmer Forums
|
BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9
This is the forum to discuss the Wrox book Professional ASP.NET 2.0 Special Edition by Bill Evjen, Scott Hanselman, Devin Rader, Farhan Muhammad, Srinivasa Sivakumar; ISBN: 9780470041789
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 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 March 13th, 2006, 04:54 PM
Registered User
 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to stanguss
Default Chapter 3 Listing 3-15

I am going over Application Folders in Chapter 3 and the error I am receiving on Listing 3-15: default.aspx in the App_Code Folder

Dim myCalc As New Calculator

The error is telling me that "Type Calculator is not defined."

It appears that even though there is a class file in the App_Code file that the class is not being seen. I also do not get any intellisense showing me the methods.

Any suggestions would be very helpful.:(
 
Old June 14th, 2007, 12:05 AM
Authorized User
 
Join Date: Nov 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you able to figure this out yet?
I had a same issue even I used the same code I downloaded from the site.
Even though I put the calculator.cs under App_code foler, The caculator class doesn't get defined.
Any ideas?

/App_code/Calculator.cs

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public class Calculator
{
    public int Add(int a, int b)
    {
        return (a + b);
    }

    public int Subtract(int a, int b)
    {
        return (a - b);
    }
}


Default.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="Server">
    protected void Page_Load(Object sender, EventArgs e)
    {
        Calculator myCalc = new Calculator();
        Label1.Text = myCalc.Add(12, 12).ToString();
    }

</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:Label ID="Label1" runat="server" ></asp:Label>
    </div>
    </form>
</body>
</html>


 
Old December 7th, 2007, 06:17 PM
Authorized User
 
Join Date: Sep 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Tarzann,
Were you ever able to solve this one? The same thing is basically driving me crazy. Thanks!
- LenexaKS

 
Old December 7th, 2007, 06:17 PM
Authorized User
 
Join Date: Sep 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I should have asked both Tarzann and Stangus... sorry.






Similar Threads
Thread Thread Starter Forum Replies Last Post
listing 15-15 pg(568) DyerOppenheimer BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 February 13th, 2008 01:41 PM
Listing 23-15 John Leo BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 April 4th, 2007 02:42 PM
chapter 15 manal_sag BOOK: Beginning ASP 3.0 2 March 13th, 2006 04:48 PM
chapter 15 manal_sag BOOK: Beginning ASP 3.0 0 April 22nd, 2005 02:23 PM
Chapter 15!! studentinpain BOOK: Beginning ASP 3.0 16 March 12th, 2004 10:26 AM





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