Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Beta Preview
This is the forum to discuss the Wrox book ASP.NET 2.0 Beta Preview by Bill Evjen; ISBN: 9780764572869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Beta Preview 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 February 21st, 2005, 12:36 AM
Registered User
 
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default can't run samples outside of IDE

code samples run fine from within IDE but get error message when I try to outside. for example, the calculator pp62-64:

Compiler Error Message: BC30002: Type 'Calculator' is not defined.

it's not a data access problem for this example. 'Calculator', by the way, is in the code folder as recommended in the book. my IIS home directory is \inetpub\wwwroot and the file is in Websies\website1 below this. IIS has ASPNET 2.0 showing.
 
Old February 23rd, 2005, 10:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Could you post the code, I don't have the book. You are using Visual Studio .NET beta?

Brian
 
Old February 24th, 2005, 01:21 AM
Registered User
 
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

here's the script on main page:
----
<script runat="server">
    Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim myCalc As New Calculator
        Label1.Text = myCalc.Add(12, 3)
        Label2.Text = myCalc.Subtract(34, 67)
    End Sub
</script>
----
The html just displays labels. the Calculator is defined in the code folder -- for testing I did the Add as VB and the Substract as CS :
-------- VB
Imports Microsoft.VisualBasic

Public Class Calculator
    Public Function Add(ByVal a As Integer, ByVal b As Integer) As Integer
        Return (a + b)
    End Function
End Class
--------

-------- CS
using System;

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

webconfig file:
.
.
<system.web>
<compilation debug="true">
     <codeSubDirectories>
     <add directoryName="VB"></add>
     <add directoryName="CS"></add>
     </codeSubDirectories>
</compilation >
</system.web>
.
.
-------

It runs fine out of the IDE (visual web developer express - part of visual stdio 2005) but gives error when I run the same program in IE (whichs runs other examples fine)
Thanks for any help you can give.

JAB
 
Old February 24th, 2005, 08:31 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You can't have the same class defined twice. In this situation, I don't know if that is the case. Defining the same class in VB and C# doesn't merge the methods into the same object.

Brian
 
Old February 24th, 2005, 10:51 AM
Registered User
 
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks.
 My point is that when I use the IDE to run it, it works fine. By the IDE I mean Visual web developer -> RUN which opens a port. My IIS shows that Framework 2.0 is active....






Similar Threads
Thread Thread Starter Forum Replies Last Post
Could not run samples datawiz1 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 10 August 11th, 2007 11:22 AM
Need samples mindserve VB.NET 2002/2003 Basics 0 August 5th, 2007 08:24 AM
How to run a java program without any IDE? AndrewH Java Basics 5 January 19th, 2007 01:52 PM
Can't get any of the samples to run... cwerth BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 7 June 16th, 2006 07:26 PM
Run Program outside IDE (please help a begginer) aepstein824 C++ Programming 1 February 27th, 2006 09:28 PM





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