Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 13th, 2006, 03:54 PM
Registered User
 
Join Date: Feb 2006
Location: Charlotte, NC, USA.
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.:(
Reply With Quote
  #2 (permalink)  
Old June 14th, 2007, 12:05 AM
Authorized User
 
Join Date: Nov 2005
Location: , , .
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>


Reply With Quote
  #3 (permalink)  
Old December 7th, 2007, 05:17 PM
Authorized User
 
Join Date: Sep 2006
Location: Lenexa, KS, USA.
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

Reply With Quote
  #4 (permalink)  
Old December 7th, 2007, 05:17 PM
Authorized User
 
Join Date: Sep 2006
Location: Lenexa, KS, USA.
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12: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 03: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 09:26 AM



All times are GMT -4. The time now is 04:20 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.