Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Simple Component


Message #1 by RBFigueira@m... on Fri, 1 Mar 2002 11:45:21 -0000
Hi friends,

I have made the example (ch15 .... i think) from the book "Begining ASP.NET
using VB.NET".
The example explan how to do an simple component (dll). The pages were made
in Notepad and the assembly compilaction were made via DOS.
The only different from the book is that i have change the assembly name to
util.
Ok , it work just fine :P 

NOW....
I have tried to made the same example but in VS.NET (RC) program.... and i
have got an error :

******* Error: ************

Compilation Error 
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately. 

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

Source Error:



Line 11: Sub Page_Load(Source As Object, E As EventArgs)
Line 12: 
Line 13:   Dim Component as new HelloVB()
Line 14: 
Line 15:   label1.text=Component.SayHello()
 

Source File: http://localhost/component1/Component1.aspx    Line: 13 

*****************************

What i have to do more ?  I have put the dependencies right and the
compilation dont give me any error ?!?!
The error occour when i run the page.....



All code :

**** The project JPG ****

http://www10.brinkster.com/rbfigueira/dotnet.jpg

*********************


**** Component1.aspx ********

<%@ Import Namespace="HelloWorld" %>

<html>
<body>

Our component says: <br /> <br />

<asp:Label id="label1" runat="server" />

<script language="vb" runat="server">

Sub Page_Load(Source As Object, E As EventArgs)

  Dim Component as new HelloVB()

  label1.text=Component.SayHello()

End Sub

</script>

</body>
</html>

*************************

**** Component1.vb ********

Namespace HelloWorld

  Public Class HelloVB 
  
    Public Function SayHello() As String

      Return "Hello World - I'm a component!"

    End Function

  End Class

End Namespace

*************************

******* web.config ************

<configuration>
  <system.web>
    <compilation>
      <assemblies>
        <add assembly="util" />
      </assemblies>
    </compilation>
  </system.web>
</configuration>

***************************

Best regards,
Ricardo Figueira (RBFIGUEIRA) 
Moderador Lista PontoNetPT (ASP.NET e VB.NET) 
http://groups.yahoo.com/group/PontoNetPT

  Return to Index