G
Guest
I'm new to asp.net so bare with me. I'm reading through the asp.net
unleashed book and am to the section on creating classes. After creating a
..vb file which I can successfully compile and placing the .dll file in the
bin directory I get the following error message: BC30002: Type 'Quote' is not
defined. Adder is in the new namespace I created in the .dll file. I know
that the coding is error free. I've check it over numerous times and even
tried all the relavent examples in the book and get the same type error
message.
One other .dll problem I have had so far is reconizing the .dll file
associated with Adp.net for Oracle but I solved this problem by copying the
..dll file directly to the bin folder.
Any help would be greatly apprcieated!
The code is as follows:
Imports System
Namespace myComponents
Public Class Quote
Dim myRand As New Random
Public Function ShowQuote() As String
Select myRand.Next( 3 )
Case 0
Return "Look before you leap"
Case 1
Return "Necessity is the mother of invention"
Case 2
Return "Life is full of risks"
End Select
End Function
End Class
End Namespace
<%@ Import Namespace="myComponents" %>
<Script Runat="Server">
Sub Page_Load
Dim myQuote As New Quote
lblOutput.Text = myQuote.ShowQuote()
End Sub
</Script>
<html>
<head><title>ShowQuote.aspx</title></head>
<body>
And the quote is...
<br>
<asp:Label
id="lblOutput"
Runat="Server" />
</body>
</html>
unleashed book and am to the section on creating classes. After creating a
..vb file which I can successfully compile and placing the .dll file in the
bin directory I get the following error message: BC30002: Type 'Quote' is not
defined. Adder is in the new namespace I created in the .dll file. I know
that the coding is error free. I've check it over numerous times and even
tried all the relavent examples in the book and get the same type error
message.
One other .dll problem I have had so far is reconizing the .dll file
associated with Adp.net for Oracle but I solved this problem by copying the
..dll file directly to the bin folder.
Any help would be greatly apprcieated!
The code is as follows:
Imports System
Namespace myComponents
Public Class Quote
Dim myRand As New Random
Public Function ShowQuote() As String
Select myRand.Next( 3 )
Case 0
Return "Look before you leap"
Case 1
Return "Necessity is the mother of invention"
Case 2
Return "Life is full of risks"
End Select
End Function
End Class
End Namespace
<%@ Import Namespace="myComponents" %>
<Script Runat="Server">
Sub Page_Load
Dim myQuote As New Quote
lblOutput.Text = myQuote.ShowQuote()
End Sub
</Script>
<html>
<head><title>ShowQuote.aspx</title></head>
<body>
And the quote is...
<br>
<asp:Label
id="lblOutput"
Runat="Server" />
</body>
</html>