Mayfield2268 Posted July 15, 2003 Posted July 15, 2003 I have created a class in Web Matrix and I'm trying to call it from a .aspx page. Here is the code for the class... Imports System Namespace sqlClass Public Class sql Public Sub New() End Sub End Class End Namespace I get the following error when I try to declare an instance of this class in my .aspx page ... Compiler Error Message: BC30002: Type 'sql' is not defined. Source Error: Line 6: Line 7: Sub Button1_Click(sender As Object, e As EventArgs) Line 8: Dim sqlVB as New sql() Line 9: Line 10: End Sub I have also tried adding a import namespace as well as removing the Namespace code from the class. Does anyone have any suggestions as to why this error is occurring. Thanks Quote
*Gurus* Derek Stone Posted July 16, 2003 *Gurus* Posted July 16, 2003 Did you compile the class? Web Matrix does not do this for you, as its meant to be used with Active Server Pages (.NET) that lack code-behind files. Quote Posting Guidelines
Mayfield2268 Posted July 16, 2003 Author Posted July 16, 2003 Thanks for the response I was able to compile the .vb file into a dll file. But of course I'm not sure what to do next. I try adding the dll to the classes tab in Web Matrix but that didn't seem to work. Any suggestions Thanks Quote
*Gurus* Derek Stone Posted July 16, 2003 *Gurus* Posted July 16, 2003 Copy the DLL into the /bin directory of your web application's root. If the directory doesn't exist, create it. Then simply import the namespace. <%@ Import Namespace="MyCompany.MyProject" %> Quote Posting Guidelines
Mayfield2268 Posted July 16, 2003 Author Posted July 16, 2003 Thanks again, that worked awesome. Hours of frustration finally came to an end. Thanks Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.