Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 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 July 30th, 2004, 07:02 PM
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with ch 13 component

When I try and run the Hello World component in chapter 13 I get the following error:

WroxComponents.HelloVB' is not defined

I get the same error when I try and run the downloaded version.

What am I missing?

Here is the code for HelloWorldExample.aspx:
<%@ Page Language="VB" %>
<script runat="server">

    Sub Page_Load
      Dim MyVBComponent as New WroxComponents.HelloVB()
      lblMessage.Text = MyVBComponent.SayHello()

    End Sub

</script>
<html>
<head>
</head>
<body>
<form runat="server">
  <p>Our component says:</p>
  <p><asp:Label id="lblMessage" runat="server" /></p>
</form>
</body>
</html>

Here is the code for HelloWorld.vb this is compiled to HelloWorld.dll:
' HelloWorld.vb
'

Imports System

Namespace WroxComponents

    Public Class HelloVB
        Public Sub New()

        End Sub

        Public Function SayHello() As String
            Return "Hello World - I'm a VB.NET component!"
        End Function
    End Class
End Namespace




 
Old July 31st, 2004, 07:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

Is it added as a component (add reference to the HellowWorld.dll) in the ASP.NET Project?

Brian
 
Old July 31st, 2004, 08:27 AM
Registered User
 
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply...

I am using WebMatrix like the book says and following along with the code. So how do I add a reference to the component in the project?
 
Old August 13th, 2004, 10:06 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was having the same problem and this is how you solve it. First of all I am assuming you are using the webserver option that comes with the WebMatrix. When you activate this webserver look very carefully at the directory it is using, ge: "c:\BegAsp11\chapter13". on that same directory you need to have a bin folder with the HelloWorld.dll file.
What bmains was refering to is that if you read I little further on the book they tell you how you register the component with the aspx project meaning that you can say where you want your dll to be found.

Hope this helps
Christian

 
Old August 16th, 2004, 08:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Yes, that is what I'm referring to. You need to compile the component and put in the bin directory. This is where the project looks for all dlls that the project needs. If you need to compile a component, you need to use the vbc executable.

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
ch 13 - sketcher menu problem zamontgo BOOK: Ivor Horton's Beginning Visual C++ 2005 0 May 24th, 2008 10:11 PM
Ch. 13/14 creating own custom controls...problem.. Chimlim BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 2 August 10th, 2005 04:21 AM
Ch 13 Try it out file synchronize.aspx mahir BOOK: Beginning ASP.NET 1.0 9 February 23rd, 2005 05:04 PM





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